Copy to clipboard
Installation
Copy to clipboard
npx bearnie add slider
npx bearnie add slider
bunx bearnie add slider
bunx bearnie add slider
pnpm dlx bearnie add slider
pnpm dlx bearnie add slider
yarn dlx bearnie add slider
yarn dlx bearnie add slider
Copy to clipboard
import Slider from "@/components/ui/slider/Slider.astro";
Usage
import { Slider } from "@/components/ui"
<Slider defaultValue={[33]} max={100} step={1} />
Examples
Range
Copy to clipboard
Multiple thumbs
Copy to clipboard
Step values
Copy to clipboard
Vertical
Copy to clipboard
Disabled
Copy to clipboard
With label
Copy to clipboard
50%
Anatomy
Slider- The main slider container with track, range, and thumb(s)
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultValue | number[] | [0] | Initial value(s). Use array with multiple values for range slider |
| min | number | 0 | Minimum value |
| max | number | 100 | Maximum value |
| step | number | 1 | Step increment |
| disabled | boolean | false | Disables the slider |
| orientation | ”horizontal” | “vertical" | "horizontal” | Slider orientation |
| name | string | - | Form input name |
| class | string | - | Additional CSS classes |