Slider
A slider with one thumb or a range of two. The thumb glides to where you press, and its number rises above it while you hover, drag or use the arrow keys.
Examples
Default
Put a SliderLabel and a SliderValue inside, and they sit in a row above the track. Press anywhere on the track and the thumb glides there.
Steps
Set step and the value moves in those steps, by pointer and by arrow keys. Page Up and Page Down move by largeStep.
Range
Give an array as the value for a thumb at each end. format sets how the number above a thumb and the value read out are written.
No visible label
Leave out the children and name it with aria-label. The page can hold the value, as the zoom buttons here do.
Invalid
In an invalid Field, the fill and the thumb turn the destructive colour and the error takes the description’s place.
Disabled
A disabled slider fades and shows no number. Say why beside it, so nobody wonders.
Installation
npx shadcn@latest add https://kinoui.com/r/slider.json- Files
lib/reduce-motion.tslib/track.tslib/number-format.tslib/resize.tscomponents/kino/slider.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Slider
Data attributes
CSS variables
Accessibility
- Each thumb is a native range input: arrow keys move it by
step, Page Up and Page Down bylargeStep, and Home and End to the ends. - Name it with
SliderLabel, or witharia-labelwhen there is no visible label. Name each thumb of a range withgetAriaLabel. - The number above a thumb is for sighted users and is hidden from screen readers, which read the thumb’s own value instead.
- In forced colours the fill takes the system highlight, and the focused thumb gets a system outline.
- When the system asks for less motion, the thumb and the fill jump to the value, and the number fades in without rising.