selection/DSSlider
DSSlider
selectionRange slider with min/max labels and an optional live value formatter.
iOS 17+macOS 14+watchOS 10+tvOS 17+visionOS 1+
Purpose
Numeric range selection — volume, price range, opacity, and similar continuous values.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | String? | nil | Label above the slider. |
| valuereq | Binding<Double> | — | Bound numeric value. |
| range | ClosedRange<Double> | 0...100 | Min and max bounds. |
| step | Double | 1 | Increment between values. |
| showValue | Bool | true | Shows the current value next to the label. |
| formatValue | ((Double) -> String)? | nil | Custom formatting for the displayed value. |
| color | Color? | nil | Track tint. nil uses the theme primary. |
Examples
Price filter
Slider with currency formatting.
swift
DSSlider(
label: "Max price",
value: $maxPrice,
range: 0...1000,
step: 10,
formatValue: { "$" + String(Int($0)) }
)