Slider

Slider on Base UI with a hairline rail, a keycap thumb, a value bubble while dragging, optional labelled marks, Intl number formatting and vertical support.

src/registry/ui/slider.tsx/r/slider.json

Alert when API usage reaches

80%

Seats

12 × $12 = $144/mo

Invoice amount

6 of 8 invoices
6 invoices match

Drag or tab to a thumb

Marks, disabled

Installation#

bash
npx shadcn@latest add @minidev/slider

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/slider.json

Usage#

tsx
import { Slider } from "@/components/ui/slider"

export function Example() {
  return (
    <Slider defaultValue={[40]} aria-label="Volume" aria-labelledby="vol-label" />
  )
}

API reference#

Slider props
PropTypeDefault
formatIntl.NumberFormatOptions | ((value: number) => string)-
marksMark[]-
showValuebooleantrue

Also accepts every prop of SliderPrimitive.Root props, passed through to the root element.

Dependencies#

npm

@base-ui/react

Built from

No other MiniDev files

Examples#

All form components

Learn more