Slider
A slider allows users to make selections from a range of values. Think of it as a custom `<input type='range'/>` with the ability to achieve custom styling and accessibility.
A slider allows users to make selections from a range of values. Think of it as a custom `<input type='range'/>` with the ability to achieve custom styling and accessibility.
API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.
string
The aria-label of the slider. Useful for providing an accessible name to the slider
string
The `id` of the element that labels the slider. Useful for providing an accessible name to the slider
number
'ltr' | 'rtl'
The document's text/writing direction.
boolean
Whether the slider is disabled
boolean
Whether to focus the slider thumb after interaction (scrub and keyboard)
string
The associate form of the underlying input element.
(value: number) => string
Function that returns a human readable value for the slider
() => ShadowRoot | Node | Document
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
string
The unique identifier of the machine.
Partial<{ root: string thumb: string control: string track: string range: string label: string output: string hiddenInput: string }>
The ids of the elements in the slider. Useful for composition.
boolean
Whether the slider value is invalid
number
The maximum value of the slider
number
The minimum value of the slider
string
The name associated with the slider (when used in a form)
(details: ValueChangeDetails) => void
Function invoked when the value of the slider changes
(details: ValueChangeDetails) => void
Function invoked when the slider value change is done
(details: ValueChangeDetails) => void
Function invoked when the slider value change is started
'horizontal' | 'vertical'
The orientation of the slider
'center' | 'start'
- "start": Useful when the value represents an absolute value - "center": Useful when the value represents an offset (relative)
boolean
Whether the slider is read-only
number
The step value of the slider
'center' | 'contain'
The alignment of the slider thumb relative to the track - `center`: the thumb will extend beyond the bounds of the slider track. - `contain`: the thumb will be contained within the bounds of the track.
Size
The slider thumb dimensions.If not provided, the thumb size will be measured automatically.
number
The value of the slider
Dict<any>
() => void
Function to decrement the value of the slider by the step.
() => void
Function to focus the slider.
(props: MarkerProps) => Dict<any>
(percent: number) => number
Returns the value of the slider at the given percent.
(value: number) => number
Returns the percent of the slider at the given value.
Dict<any>
() => void
Function to increment the value of the slider by the step.
boolean
Whether the slider is being dragged.
boolean
Whether the slider is focused.
Dict<any>
Dict<any>
Dict<any>
number
The value of the slider as a percent.
Dict<any>
Dict<any>
(value: number) => void
Function to set the value of the slider.
Dict<any>
Dict<any>
number
The value of the slider.
number