Percent-of-balance slider for trading forms, with major stops, sub-ticks, keyboard support, and a fixed value readout.
Anatomy
0% 25% 50% 75% 100% |---.---.---|---.---.---|---.---.---|---.---.---| ===============o [ 38% ]
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
value | number | -- | 0-100; rounded and clamped. |
onValueChange | (value:number)=>void | -- | Fires on drag, click, keyboard, or stop-label click. |
stops | readonly number[] | [0,25,50,75,100] | Major labelled stops. |
label | string | Size as percent of balance | Slider accessible name. |
disabled | boolean | false | Removes tab stop and dims the control. |
showSubTicks | boolean | true | Three sub-ticks per stop interval. |
className | string | -- | cn-merged. |
Motion
Track fill and thumb position transition at 150ms when not dragging. Dragging writes directly so the thumb stays under the pointer.
A11y
- · Thumb uses
role="slider"witharia-valuenowandaria-valuetext. - · Arrow keys nudge by 1; Shift+Arrow nudges by 5; Home/End jump to 0/100.
- · Stop labels are buttons for direct jumps.
- · Disabled removes the thumb from tab order and marks it
aria-disabled.