selection/DSSlider

DSSlider

selection
since v1.0

Range 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

PropTypeDefaultDescription
valuereqBinding<Double>Bound numeric value.
rangereqClosedRange<Double>Min and max bounds.
stepDouble?nilDiscrete step. nil = continuous.
labelString?nilLabel above the slider.
valueFormatter((Double) -> String)?nilCustom value display.

Examples

Price filter

Range slider with currency formatting.

swift
DSSlider(
    value: $maxPrice,
    range: 0...1000,
    label: "Max Price",
    valueFormatter: { "$\(Int($0))" }
)

Related Components