One line renders the root, the control, the track, the indicator, and one thumb per value. The children go above the control.
volume-slider.tsx
Slider
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| control | ReactNode | — | The control under the children. Default: a SliderControl with the track, the indicator, and one thumb per value. Pass your own SliderControl to change a part (a thumb with a Tooltip). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| thumb | Omit<SliderThumbProps, "index"> | — | Props for every default thumb: getAriaLabel, getAriaValueText, aria-label, disabled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tone | "destructive""info""neutral""success""warning" | "neutral" | default: the primary fill. A status colors the fill and the thumb edge: success a good value, warning a value that needs care, info a neutral mark, destructive a value over a limit. Color is never the only signal: say it in words too. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| glow | boolean | — | A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant | "bare""default""playhead" | "default" | default: the track, the fill, and round thumbs. playhead: an invisible track over the parent's whole box and a 2px line thumb, for a scrub over a waveform or a timeline (the parent draws the played part). bare: the same press area with thumbs that the item draws (children of SliderThumb), for the handles of a timeline. Default default. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UISlider.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default | Value | — | The uncontrolled value of the slider when it's initially rendered. To render a controlled slider, use the value prop instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the slider should ignore user interaction. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| format | NumberFormatOptions | — | Options to format the value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SliderLabel
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SliderValue
<output>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UISlider.ValueBase UI docs | |||
| children | — | ||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <output> attributes | — | Every other attribute goes to the <output>, with a ref. |
SliderControl
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SliderTrack
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SliderIndicator
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SliderThumb
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||
From Base UISlider.ThumbBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the thumb should ignore user interaction. | |||||||||||||||||||||||||||||||||||||||||||||
| aria-valuetext | string | — | A string value forwarded to the aria-valuetext attribute of the input. Ignored when getAriaValueText is provided. | |||||||||||||||||||||||||||||||||||||||||||||
| get | ((index: number) => string) | null | — | A function which returns a string value for the aria-label attribute of the input. | |||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||
| Arrow keys | Changes the value by one step. Left and Right follow the direction of the page. |
|---|---|
| Shiftarrow keysorPage UporPage Down | Changes the value by largeStep. |
| HomeorEnd | Goes to the minimum or the maximum. |
| Tab | Moves to the next thumb. |
- Elastic SliderA slider whose track stretches past its ends and springs back when you let go. It has a value tag that sways, marks that hold the thumb, and end icons.
- Ruler SliderPick Ruler Slider to pick a value on a moving scale under a fixed line, such as an angle or a zoom.
- Color SliderChange one channel of a color on a 12px gradient track: hue, saturation, lightness, brightness, red, green, blue, or alpha.
- FieldPuts a label, a control, and one line of help or an error together. FieldSet groups several controls under one legend.
- Number FieldPick Number Field to type an exact number with steps and limits.









