Slider
Picks a number, or a range, by dragging or with the arrow keys; Page Up and Page Down take big steps, Home and End go to the ends. Built on ui-sdk's Slider. Pair it with SliderValue or a field so the number can be read.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { Slider, SliderValue } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Pair it with SliderValue or a field, so the number can be read, like a 60% probability on an opportunity. |
| Do | Name it with aria-label or a Label. For a range, name each thumb with thumbLabels, like Minimum and Maximum. |
| Do | Save in onValueCommit, which runs when the drag ends, rather than on every step of onValueChange. |
| Don't | Use it for an exact figure, like a fee estimate or a matter number. Use Input: typing an exact value is faster than dragging to it. |
Props
Slider also takes ui-sdk's value, defaultValue, onValueChange, onValueCommit, min, max, step, largeStep, minStepsBetweenThumbs, orientation, disabled, readOnly, name, format and locale.
Slider
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Shown after the track, like a SliderValue readout. |
| thumbLabels | string[] | — | Names each thumb for screen readers when there's more than one, like ["Minimum", "Maximum"]. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
SliderValue
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import { Slider, SliderValue } from "@leap-crm/design-system";
<Slider defaultValue={60} aria-label="Probability" min={0} max={100} step={5}>
<SliderValue />
</Slider>Range
Two thumbs pick a range; name each one with thumbLabels.
Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| ArrowRightArrowUp | Increase it by one step. |
| ArrowLeftArrowDown | Decrease it by one step. |
| Page UpPage Down | Move by the large step, as Shift with an arrow key does. |
| HomeEnd | Go to the minimum and the maximum. |
| Tab | Moves through the thumbs in order. |



