LavaUI docs GitHub

struct HStack

Swift

struct HStack<Content> where Content : View

Lays its children out left to right.

Sources/LavaUI/Stack.swift:62

Constructors

init(flexGrow: Float = 0, width: Dimension = .auto, height: Dimension = .auto, padding: Float = 0, alignment: StackAlignment = .stretch, spacing: Float? = nil, wraps: Bool = false, onClick: (() -> Void)? = nil, onPointer: ((_ mods: Int32, _ button: Int32) -> Void)? = nil, onHover: ((Bool) -> Void)? = nil, onWheel: ((Float, Float) -> Void)? = nil, @ViewBuilder content: () -> Content)

Creates a row. Every parameter matches the property of the same name.

Sources/LavaUI/Stack.swift:79

Properties

var content: Content

The children.

Sources/LavaUI/Stack.swift:66

var dumpDetail: String { get }

Not documented.

Sources/LavaUI/Stack.swift:104

var onClick: (() -> Void)?

Called when the stack, or a child with no click handler of its own, is clicked.

Sources/LavaUI/Stack.swift:68

var onHover: ((Bool) -> Void)?

Called with true when the pointer enters the stack and false when it leaves.

Sources/LavaUI/Stack.swift:73

var onPointer: ((_ mods: Int32, _ button: Int32) -> Void)?

Button-aware press (PointerButton.left / .right / …). When set, takes priority over onClick.

Sources/LavaUI/Stack.swift:71

var onWheel: ((Float, Float) -> Void)?

Called with the deltas, in notches, when the wheel turns over the stack. Setting it keeps the wheel from reaching a ScrollView around the stack.

Sources/LavaUI/Stack.swift:76

var style: StackStyle

Size, padding, spacing and alignment.

Sources/LavaUI/Stack.swift:64

Methods

func mountPrimitive() -> any AnyViewNode

Not documented.

Sources/LavaUI/Stack.swift:114

func reconcilePrimitive(_ node: any AnyViewNode) -> any AnyViewNode

Not documented.

Sources/LavaUI/Stack.swift:127

func structureLines(indent: Int = 0) -> [String]

Not documented.

Sources/LavaUI/Stack.swift:106