shadcn Slider
Draft portable input atoms.
Ordinary demos on this page explicitly use Shadcn Rhea, with matching examples. This does not change public compatibility defaults or imply complete browser, native-host or visual acceptance. Neutral Surface/Text atoms retain their own public semantics; the consumer composition supplies the family presentation theme.
Root owns value/defaultValue, min/max/step, disabled/readOnly, orientation and direction. Track uses shared normalized AxisInput for real pointer/touch drag. Thumb is one focusable slider: arrows, Shift×10, PageUp/PageDown, Home/End; horizontal RTL reverses lateral arrows. Values clamp and snap from min. Controlled requests emit valueChange while retaining owner values; valueCommit marks completion, cancel restores an uncontrolled drag start. Label names Thumb; Value and Indicator are passive. Single-thumb behavior is implemented; multi-thumb constraints remain open.
Use FieldThumb instead of Thumb inside Field/FormField to bridge FieldLabel activation, canonical numeric validation, policy, Form serialization and reset. Standalone Thumb continues to use SliderLabel.
Parts: root, label, track, indicator, thumb, field-thumb, value. All four styled families inherit Base behavior.
Draft source work. Full native, assistive-technology, Adapter/Compiler/GPUI, package consumer and independent acceptance remain open. No Finf completion is claimed.
The selected Rhea scalar recipe uses a 4px rail and a 16px passive white Thumb with family radius-2xl, shadow and a 1px resting ring; hover/focus add a 4px ring. The real Thumb hit box is 16px at the default root font. The retained unscoped Nova recipe is separately 4px/12px paint with a 28px hit box. Paint remains passive Proto Template output: Track owns input and geometry; Thumb/FieldThumb remain the only focus targets. Disabled dims the control; readOnly preserves focus/hover but prevents editing. None of these source dimensions is a native screenshot result.
This is not complete shadcn equivalence. The current pointer interval still places thumb centers at track endpoints; upstream thumbAlignment="edge" needs a shared paint/input geometry contract before either can be shifted. Range/multiple thumbs, exact upstream active behavior under all native capture paths, cross-theme pixel matching and native host fidelity remain open. The examples expose those boundaries rather than hiding them.
This entry is workspace source. It is not a public proto-ui add catalog id.
Passing value selects controlled mode.
| Prop | Type | Default |
|---|---|---|
value | number undefined | uncontrolled |
defaultValue | number | 0 |
min | number | 0 |
max | number | 100 |
step | number | 1 |
disabled | boolean | false |
readOnly | boolean | false |
orientation | 'horizontal' 'vertical' | horizontal |
direction | 'ltr' 'rtl' | ltr |
ariaLabel | string | '' |
valueText | string | '' |