Slider
A value along a track, tuned by feel: a level, or a size with its track widening and its ink on the thumb.
import { Slider } from "@arcadia/ui"TSX
Examples
--slider-length- Ref<Space | Measure> | `calc(${Ref<Space>} * ${number})` | "100%"Default calc(var(--space-16) * 3)
- Its length along its axis. Default 192.
--slider-bg- PaintDefault transparent
- The surface it stands on: none by default; a raised one where it stands over a picture.
--slider-track- PaintDefault var(--fill-2)
- Its track.
--slider-thumb- PaintDefault var(--icon-1)
- Its thumb, where no
inkis given.
- Arrow keys
- One step
- Page Up, Page Down
- A tenth of its range
- Home, End
- Its least and its most
Slider
labelrequired- string
- Required: its name for assistive technology ("Size").
value- number
- Controlled value.
defaultValue- numberDefault min
- Initial value when uncontrolled.
onValueChange- (value: number) => void
- Called with each new value as it is set.
onActiveChange- (active: boolean) => void
- While it is being set, by a drag or a key, until it lets go or loses focus: what it sets can be shown at its true scale meanwhile.
min- numberDefault 0
max- numberDefault 100
step- numberDefault 1
orientation- "horizontal" | "vertical"Default "horizontal"
horizontalgrows to the inline end;verticalgrows upward.scale- "linear" | "root"Default "linear"
root: the travel is the square root of the value's share, so steps are finer toward the start, where a pixel shows.taper- booleanDefault false
- The track widens from its start to its end: the slider sets a size.
ink- string
- The colour its thumb shows,
#rrggbb: what the size is of (an ink). valueText- (value: number) => string
- What a reader hears for a value ("12 pixels"). Default the number.
disabled- booleanDefault false
rootStyle- RootStyle<SliderKnobs>
- Typed StyleX override: layout and the
--slider-*knobs.
Rest props go to <div> props.