Slider
Range input primitive.
Preview
A live, theme-aware example rendered with the published component.
Loading preview…
Import
Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.
tsximport { Slider } from "@tavojs/ui/slider";Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/slider.
When to use
Use it when
Choose something else when
Examples
Slider example
tsximport { Slider } from "@tavojs/ui/slider";
export function SliderExample1() {
return (
<>
<Slider min={0} max={100} value={72} />
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
min | number | — | Configures min for this component. |
max | number | — | Configures max for this component. |
step | number | — | Configures step for this component. |
Complete TypeScript API
Import from @tavojs/ui/slider. Published exports: Slider, SliderProps.
SliderProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by Slider. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by Slider. |
id | string | No | Inherited id attribute accepted by Slider. |
role | string | No | Inherited role attribute accepted by Slider. |
style | Record<string, unknown> | No | Inherited style attribute accepted by Slider. |
title | string | No | Inherited title attribute accepted by Slider. |
tabIndex | number | No | Inherited tabIndex attribute accepted by Slider. |
hidden | boolean | No | Inherited hidden attribute accepted by Slider. |
disabled | boolean | No | Inherited disabled attribute accepted by Slider. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by Slider. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by Slider. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by Slider. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by Slider. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by Slider. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by Slider. |
min | number | No | Configures min for this component. |
max | number | No | Configures max for this component. |
step | number | No | Configures step for this component. |
value | number | No | Inherited value attribute accepted by Slider. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | No component state contract is exposed; the application owns the rendered content and surrounding behavior. |
| DOM target | Native input attributes target the owned form control; wrapper-specific props stay on the documented component root. |
Anatomy and related components
Limitations
Avoid Slider when wrapping controls without labels or accessible names.
Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.
Accessibility
Form components pass through native attributes and should be paired with visible labels or accessible names.
Use Field, FormLabel, FormControlLabel, or aria-label for labeling.
Preserve native input semantics whenever possible.
Expose validation with error text and aria-invalid where relevant.
Component status
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | forms |
| Component import | @tavojs/ui/slider |
| Explicit CSS import | @tavojs/ui/css/slider |
| Preview | Interactive preview available on this page |