# Slider (@limerdev/zest) A value picked by dragging a thumb along a track, or with the arrow keys (Page Up and Down for big steps, Home and End for the ends): `type="single"` binds a number, `type="multiple"` a number[] with one thumb each (a range). `min`, `max`, `step`, `orientation`. Inside a `Field` the thumbs are named by `Field.Label` and described by its description and error; outside one, give each thumb a name with `aria-label`. - Category: Data input - Import: `import { Slider } from '@limerdev/zest'` - Bits UI: `Slider`, https://bits-ui.com/docs/components/slider - Exports: `Slider` - Use for: A value where the rough position matters more than the exact number: volume, a price range filter, a percentage. - Don't: An exact number people type: use `Input type="number"`. Few options: use `RadioGroup` or `ToggleGroup`. ```svelte Billable share {rate}% of logged time. ``` Props of `Slider`: - `autoSort` (`boolean`, default `true`): Whether to automatically sort the values in the array when moving thumbs past one another. - `dir` (`"ltr" | "rtl"`, default `'ltr'`): The direction of the slider. For vertical sliders, setting `dir` to `'rtl'` will caus the slider to start from the top and move downwards. For horizontal sliders, setting `dir` to `'rtl'` will cause the slider to start from the left and move rightwards. - `disabled` (`boolean`, default `false`): Whether the slider is disabled or not. - `max` (`number`, default `100 (for number step) or the max value of the step array (for array step)`): The maximum value of the slider. - `min` (`number`, default `0 (for number step) or the min value of the step array (for array step)`): The minimum value of the slider. - `onValueChange` (`OnChangeFn | OnChangeFn`): A callback function called when the value changes. - `onValueCommit` (`OnChangeFn | OnChangeFn`): A callback function called when the user stops dragging the thumb and the value is committed. - `orientation` (`"horizontal" | "vertical"`, default `'horizontal'`): The orientation of the slider. - `step` (`number | number[]`, default `1`): The amount to increment the value by when the user presses the arrow keys, or an array of specific values that the slider can snap to. When an array is provided, the slider will only allow values that exist in the array, creating discrete tick points. The array values should be within the min/max range and will be automatically sorted. - `thumbPositioning` (`"exact" | "contain"`, default `"contain"`): The positioning of the slider thumb. - `trackPadding` (`number`): Padding percentage for the track. Creates space before the first and after the last tick positions. This can also be used as an SSR-friendly alternative to `thumbPositioning="contain"`, which requires client-side measurement. - `type` (`"multiple" | "single"`, required): The type of slider. If set to `'multiple'`, the slider will allow multiple ticks and the `value` will be an array of numbers. - `value` (`number | number[]`, default `min`, bindable): The value of the slider. Example: Basic In a Field, the label names the thumb. Arrow keys move by step. ```svelte Billable share {share}% of logged time is billed. ``` Example: A range type="multiple" picks a range with two thumbs; name each thumb outside a Field. ```svelte

Projects with {hours[0]}–{hours[1]} hours logged

```