Basic Usage
Controlled Value
Event Handlers
Event fired continuously while dragging
Event fired when dragging ends (on pointer up)
Range Configuration
Minimum allowed value
Maximum allowed value
Granularity of value changes
Step size for Page Up/Down and Shift+Arrow keys
Value Props
Current slider value (controlled). Use array for range sliders.
Initial value (uncontrolled)
Range Slider
Use array values for range selection:Minimum distance between thumbs in range slider
Orientation
Layout direction of the slider
Disabled State
Disables slider interaction
Real Example
From demo atdemo/demo.py:34:
Compositional API
For advanced layouts:Slider Components
slider.root
Container for all slider parts.slider.value
Displays the current numeric value.slider.control
Clickable interactive area.slider.track
Background track element.slider.indicator
Visual indicator showing filled portion.slider.thumb
Draggable thumb element.Styling Classes
Access predefined styles viaui.slider.class_names:
ROOT: Container flex layoutVALUE: Value text displayCONTROL: Interactive control areaTRACK: Background trackINDICATOR: Filled indicatorTHUMB: Draggable thumb with shadow
Thumb Behavior
How thumbs align at min/max positions
How thumbs interact when they collide in range sliders
Form Integration
Form field name for submission
Keyboard Controls
- Arrow Left/Down: Decrease by
step - Arrow Right/Up: Increase by
step - Page Down: Decrease by
large_step - Page Up: Increase by
large_step - Home: Jump to
min - End: Jump to
max
Implementation Details
From source code atreflex_ui/components/base/slider.py:206:
- Built on Base UI Slider primitives
- High-level wrapper auto-creates complete structure
- Supports single and range values
- Thumb scales up slightly when dragging
- Width capped at 16rem (256px) by default