Children go above the track. Add the end icons as parts, and tooltip for the value tag.
volume-slider.tsx
ElasticSlider
<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" | — | 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| elastic | boolean | true | The rubber track: a press swells the active thumb and thickens the track, a drag past an end stretches the track with resistance, and the release springs back with one wobble. Home or End at a limit bumps the track. Default true. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tooltip | "always" | boolean | false | A value tag over each thumb (ElasticSliderThumbTooltip). true: it shows on hover, on keyboard focus, and while dragging, and sways with the drag speed. "always": it always shows. A SliderValue fades out while a tag shows, so one value is on screen. Default false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| marks | — | Marks on the track: values, or { value, label } with a label under the track. A drag holds on a mark for 6px (a detent) and a ring pops from the thumb; a press on a label sets its value. Keys and track presses step past marks. Made for thumbAlignment="center" (the 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ElasticSliderStartIcon
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ElasticSliderEndIcon
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ElasticSliderControl
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ElasticSliderTrack
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ElasticSliderThumb
<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. | |||||||||||||||||||||||||||||||||||||||||||||
ElasticSliderMarks
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ElasticSliderMarkLabels
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ElasticSliderThumbTooltip
<span>| Arrow keys | Changes the value by one step. |
|---|---|
| Shiftarrow keysorPage UporPage Down | Changes the value by largeStep. |
| HomeorEnd | Goes to the minimum or the maximum. At a limit, the track bumps. |
Built with
Installs with Elastic Slider
- Components
- Slider







