An input where the user selects a value from within a given range.
import { Slider } from "@ngrok/mantle/slider";
<Slider defaultValue={67} max={100} step={1} />;
<Slider defaultValue={67} max={100} step={1} disabled />
<Slider defaultValue={67} max={100} step={1} orientation="vertical" />A basic slider with a single thumb for selecting a single value. You can pass a single number instead of an array.
import { Slider } from "@ngrok/mantle/slider";
<Slider defaultValue={75} max={100} step={1} />;Use two values to create a range slider with two thumbs.
import { Slider } from "@ngrok/mantle/slider";
<Slider defaultValue={[25, 50]} max={100} step={5} />;Use more than two values to create a slider with multiple thumbs.
import { Slider } from "@ngrok/mantle/slider";
<Slider defaultValue={[10, 20, 70]} max={100} step={10} />;Use the color prop to change the color of the slider range. Accepts any Tailwind bg-* class.
import { Slider } from "@ngrok/mantle/slider";
<Slider defaultValue={67} max={100} step={1} color="bg-warning-500" />;
<Slider defaultValue={67} max={100} step={1} color="bg-danger-500" />;
<Slider defaultValue={67} max={100} step={1} color="bg-emerald-500" />;Use the showTicks prop to show tick marks at each step interval along the track.
import { Slider } from "@ngrok/mantle/slider";
<Slider defaultValue={50} max={100} step={10} showTicks />;
<Slider defaultValue={[20, 80]} max={100} step={20} showTicks />;The Slider is built on top of Radix Slider. It accepts all props from the Radix Slider Root component.
defaultValue and value both accept number | number[], but they must be the same type — you cannot mix a single number with a number[].