
Premium solid slider with full Base UI part coverage, labels, value readout, range thumbs, form integration, and state-aware styling.
npx shadcn@latest add https://ui.edbn.me/api/analytics/registry/slider.jsonGroups all slider parts. Renders a div element.
namestringField name used when a form is submitted.
formstringID of the form that owns the slider inputs.
defaultValuenumber | readonly number[]Initial uncontrolled slider value.
valuenumber | readonly number[]Controlled slider value.
onValueChange(value, eventDetails) => voidCalled when the slider value changes.
onValueCommitted(value, eventDetails) => voidCalled when pointer or keyboard interaction commits.
minnumber0Minimum allowed value.
maxnumber100Maximum allowed value.
stepnumber1Step increment.
largeStepnumber10Step used by Page Up/Down or Shift + Arrow keys.
minStepsBetweenValuesnumber0Minimum step distance between range thumbs.
orientation'horizontal' | 'vertical''horizontal'Slider orientation.
thumbAlignment'center' | 'edge' | 'edge-client-only''center'How thumbs align to the control edges at min and max.
thumbCollisionBehavior'push' | 'swap' | 'none''push'How range thumbs behave when they collide.
formatIntl.NumberFormatOptionsFormatting options for displayed values.
localeIntl.LocalesArgumentruntime localeLocale used when formatting values.
disabledbooleanfalseDisables slider interaction.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged. |
| data-orientation | Slider orientation: horizontal or vertical. |
| data-disabled | Present when the slider is disabled. |
| data-valid | Present when wrapped in a valid Field.Root. |
| data-invalid | Present when wrapped in an invalid Field.Root. |
| data-dirty | Present when the field value changed from its initial value. |
| data-touched | Present when the field has been touched. |
| data-focused | Present when the field is focused. |
Accessible label automatically associated with the slider thumbs. Renders a div element.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
Displays formatted current values. Renders an output element.
childrennull | ((formattedValues, values) => React.ReactNode)Optional render callback for custom value text.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged. |
| data-orientation | Slider orientation: horizontal or vertical. |
| data-disabled | Present when the slider is disabled. |
| data-valid | Present when wrapped in a valid Field.Root. |
| data-invalid | Present when wrapped in an invalid Field.Root. |
| data-dirty | Present when the field value changed from its initial value. |
| data-touched | Present when the field has been touched. |
| data-focused | Present when the field is focused. |
Clickable interactive slider area. Renders a div element.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged. |
| data-orientation | Slider orientation: horizontal or vertical. |
| data-disabled | Present when the slider is disabled. |
| data-valid | Present when wrapped in a valid Field.Root. |
| data-invalid | Present when wrapped in an invalid Field.Root. |
| data-dirty | Present when the field value changed from its initial value. |
| data-touched | Present when the field has been touched. |
| data-focused | Present when the field is focused. |
Contains the indicator and represents the full slider range. Renders a div element.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged. |
| data-orientation | Slider orientation: horizontal or vertical. |
| data-disabled | Present when the slider is disabled. |
| data-valid | Present when wrapped in a valid Field.Root. |
| data-invalid | Present when wrapped in an invalid Field.Root. |
| data-dirty | Present when the field value changed from its initial value. |
| data-touched | Present when the field has been touched. |
| data-focused | Present when the field is focused. |
Visualizes the selected value or range. Renders a div element.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged. |
| data-orientation | Slider orientation: horizontal or vertical. |
| data-disabled | Present when the slider is disabled. |
| data-valid | Present when wrapped in a valid Field.Root. |
| data-invalid | Present when wrapped in an invalid Field.Root. |
| data-dirty | Present when the field value changed from its initial value. |
| data-touched | Present when the field has been touched. |
| data-focused | Present when the field is focused. |
Draggable slider handle. Renders a div element and nested range input.
indexnumberThumb index for range sliders.
disabledbooleanfalseDisables this thumb.
getAriaLabel(index) => stringReturns the nested input aria-label.
getAriaValueText(formattedValue, value, index) => stringReturns the nested input aria-valuetext.
inputRefReact.Ref<HTMLInputElement>Ref for the nested range input.
onBlurReact.FocusEventHandler<HTMLInputElement>Blur handler forwarded to the nested input.
onFocusReact.FocusEventHandler<HTMLInputElement>Focus handler forwarded to the nested input.
tabIndexnumberTab index forwarded to the nested input.
classNamestring | ((state) => string | undefined)CSS class name or state function.
styleReact.CSSProperties | ((state) => React.CSSProperties | undefined)Inline style object or state function.
renderReactElement | ((props, state) => ReactElement)Custom render element or render function.
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged. |
| data-orientation | Slider orientation: horizontal or vertical. |
| data-disabled | Present when the slider is disabled. |
| data-valid | Present when wrapped in a valid Field.Root. |
| data-invalid | Present when wrapped in an invalid Field.Root. |
| data-dirty | Present when the field value changed from its initial value. |
| data-touched | Present when the field has been touched. |
| data-focused | Present when the field is focused. |
| data-index | Thumb index in range sliders. |