Slider
An options-screen slider with a narrow stone handle.
Install and use
The first command adds the component and the Mine theme, the second adds this example. Render <Mine> once near your root for the skin, sounds and narrator.
"use client"
import { Field, FieldLabel } from "@/components/ui/field"
import {
Slider,
SliderControl,
SliderIndicator,
SliderThumb,
SliderTrack,
SliderValue,
} from "@/components/ui/slider"
function Example() {
return (
<Field>
<Slider
defaultValue={[25, 50]}
step={5}
format={{
style: "currency",
currency: "USD",
maximumFractionDigits: 0,
}}
>
<div data-slot="row">
<FieldLabel>Price</FieldLabel>
<SliderValue />
</div>
<SliderControl>
<SliderTrack>
<SliderIndicator />
<SliderThumb index={0} aria-label="Minimum price" />
<SliderThumb index={1} aria-label="Maximum price" />
</SliderTrack>
</SliderControl>
</Slider>
</Field>
)
}
export { Example }