selection/DSSlider
DSSlider
selectionRange slider with min/max labels and an optional live value formatter.
iOS 17+macOS 14+
Purpose
Numeric range selection — volume, price range, opacity, and similar continuous values.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuereq | Binding<Double> | — | Bound numeric value. |
| rangereq | ClosedRange<Double> | — | Min and max bounds. |
| step | Double? | nil | Discrete step. nil = continuous. |
| label | String? | nil | Label above the slider. |
| valueFormatter | ((Double) -> String)? | nil | Custom value display. |
Examples
Price filter
Range slider with currency formatting.
swift
DSSlider(
value: $maxPrice,
range: 0...1000,
label: "Max Price",
valueFormatter: { "$\(Int($0))" }
)