LavaUI docs GitHub

struct HSplitView

Swift

struct HSplitView<Leading, Trailing> where Leading : View, Trailing : View

Two side-by-side panes with a draggable divider between them.

VSplitView on the other axis, and everything documented there holds here with widths in place of heights: the split is a fraction of the shared width, minLeading / minTrailing are where the drag stops, and a pane that should fill its width needs to say so.

HSplitView(fraction: $sidebarSplit, minLeading: 180, minTrailing: 320) {
    fileList
} trailing: {
    EditorView(text: $text).flexGrow(1)
}

Sources/LavaUI/SplitView.swift:134

Constructors

init(fraction: Binding<Float>, minLeading: Float = 80, minTrailing: Float = 80, style: SplitStyle = SplitStyle(), @ViewBuilder leading: () -> Leading, @ViewBuilder trailing: () -> Trailing)

Split driven by app state, so it can be persisted or set from elsewhere.

Sources/LavaUI/SplitView.swift:153

init(initialFraction: Float = 0.5, minLeading: Float = 80, minTrailing: Float = 80, style: SplitStyle = SplitStyle(), @ViewBuilder leading: () -> Leading, @ViewBuilder trailing: () -> Trailing)

Split the view keeps for itself, starting at initialFraction.

Sources/LavaUI/SplitView.swift:171

Properties

var dumpDetail: String { get }

Not documented.

Sources/LavaUI/SplitView.swift:188

var fraction: Binding<Float>?

Where the app keeps the split: the leading pane's share of the width the two panes share, written when a drag ends. nil leaves the value on the node, which lives as long as the view does.

Sources/LavaUI/SplitView.swift:138

var initialFraction: Float

The leading pane's share of the width, used only at mount, when there is no binding to read.

Sources/LavaUI/SplitView.swift:140

var leading: Leading

The left pane.

Sources/LavaUI/SplitView.swift:148

var minLeading: Float

Narrowest the leading pane may be dragged, in points.

Sources/LavaUI/SplitView.swift:142

var minTrailing: Float

Narrowest the trailing pane may be dragged, in points.

Sources/LavaUI/SplitView.swift:144

var style: SplitStyle

How the divider looks and how wide its grab strip is.

Sources/LavaUI/SplitView.swift:146

var trailing: Trailing

The right pane.

Sources/LavaUI/SplitView.swift:150

Methods

func mountPrimitive() -> any AnyViewNode

Not documented.

Sources/LavaUI/SplitView.swift:202

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

Not documented.

Sources/LavaUI/SplitView.swift:211

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

Not documented.

Sources/LavaUI/SplitView.swift:192