LavaUI docs

struct Slider

Swift

struct Slider

A draggable value in a range.

Unlike Button and Toggle, this is a drag control: the press captures the pointer and every move recomputes the value, so the interesting part is coordinate conversion rather than animation. The knob position is not animated at all — during a drag it has to sit under the pointer, and interpolating there reads as the control lagging behind the hand.

No label. A slider's label is not part of its hit target, so it composes better as a neighbouring Text than as a bundled string — which is the opposite of Toggle, where the label is part of what you click.

Sources/LavaUI/Slider.swift:14

Constructors

init(value: Binding<Float>, in range: ClosedRange<Float> = 0...1, step: Float? = nil, format: ((Float) -> String)? = nil, style: SliderStyle = SliderStyle(), font: UIFont? = nil, isEnabled: Bool = true)

Not documented.

Sources/LavaUI/Slider.swift:25

Properties

var dumpDetail: String { get }

Not documented.

Sources/LavaUI/Slider.swift:45

var font: UIFont?

Not documented.

Sources/LavaUI/Slider.swift:22

var format: ((Float) -> String)?

Renders a readout to the right of the track. nil draws no readout.

Sources/LavaUI/Slider.swift:20

var isEnabled: Bool

Not documented.

Sources/LavaUI/Slider.swift:23

var range: ClosedRange<Float>

Not documented.

Sources/LavaUI/Slider.swift:16

var resolvedFont: UIFont? { get }

Not documented.

Sources/LavaUI/Slider.swift:43

var step: Float?

Quantisation. nil is continuous.

Sources/LavaUI/Slider.swift:18

var style: SliderStyle

Not documented.

Sources/LavaUI/Slider.swift:21

var value: Binding<Float>

Not documented.

Sources/LavaUI/Slider.swift:15

Methods

func mountPrimitive() -> any AnyViewNode

Not documented.

Sources/LavaUI/Slider.swift:56

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

Not documented.

Sources/LavaUI/Slider.swift:64