Slider
A draggable control for picking a number or a range.
Usage
Slider renders the track, fill, and thumb(s) for you — you don't compose parts. The number of thumbs follows the value: a single number renders one thumb, an array renders one per entry (a range). Use it uncontrolled with defaultValue, or controlled with value + onValueChange.
A thumb has no visible text, so give it a name with thumbAriaLabel (a string, or a (index) => string function for ranges). By default a tooltip shows the current value while a thumb is hovered, focused, or dragged.
Examples
Range
Pass an array defaultValue (or value) to get one thumb per entry. The fill spans between them. thumbAriaLabel can be a function of the thumb index to name each end.
Steps
step sets the granularity; min and max set the bounds. Arrow keys move by step, Shift/Page Up·Down by largeStep.
Tooltip visibility
tooltipVisibility controls the value bubble: auto (default — on hover/focus/drag), always (pinned), or never.
Vertical
Pass orientation="vertical" to lay the slider out top-to-bottom (it fills its container's height, with a sensible minimum). Works for single and range sliders.
Controlled
Drive the value with value + onValueChange to react to every move. Here three sliders compose an RGB picker, each channel feeding a live color swatch.
Disabled
disabled dims the slider and blocks interaction.
RTL
Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.
The track fills from the end edge (right) and the arrow keys that increase the value flip with the direction. For setup details and caveats, see the RTL guide.
API reference
The tooltipVisibility and thumbAriaLabel props are Appica additions; every other prop is forwarded to Base UI's Slider.Root.
Slider wraps Base UI's Slider (Root, Control, Track, Indicator, Thumb, Value) and forwards every remaining Root prop. It exposes data-* state attributes (data-orientation, data-disabled, data-dragging, …) on the root and its parts for styling.
Accessibility
- Each thumb is a
role="slider"witharia-valuenow/aria-valuemin/aria-valuemax. Give it a name viathumbAriaLabel, or an external label associated with the control. - Keyboard: ←/→ (or ↑/↓) move by
step, Shift+arrow and Page Up·Down move bylargeStep, Home/End jump to min/max. disabledblocks interaction and exposesdata-disabledfor styling.- The tooltip and thumb-scale animations honour
prefers-reduced-motion.