# Slider

Pick a number or a range by dragging or with the arrow keys.

- **Use it for**: Picking a number in a range where the exact value matters less than the position.
- **Not for**: Precise values people type. Try [Input](https://unseenui.com/components/input/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { Slider } from '@stackunseen/ui';
import { Field } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<Field label="Preview scale" labelAs="span"><Slider value={scale} onValueChange={setScale} min={0} max={100} thumbLabels={["Preview scale"]} getValueLabel={value => `${value}%`} /></Field>
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `getValueLabel` | `((value: number, index: number) => string)` | Include meaningful units, e.g. |
| `thumbLabels` | `readonly string[]` | Distinguish each thumb when a range has multiple values. |

## Keyboard

Arrow keys adjust by one step; Home and End move to bounds. Tab visits each available thumb.

## Works with

[Field](https://unseenui.com/components/field/), [Input](https://unseenui.com/components/input/), [Textarea](https://unseenui.com/components/textarea/), [Checkbox](https://unseenui.com/components/checkbox/), [Switch](https://unseenui.com/components/switch/), [RadioGroup](https://unseenui.com/components/radio-group/), [TonePad](https://unseenui.com/components/tone-pad/), [InputGroup](https://unseenui.com/components/input-group/), [Combobox](https://unseenui.com/components/combobox/), [Calendar](https://unseenui.com/components/calendar/), [DateRangePicker](https://unseenui.com/components/date-range-picker/), [Select](https://unseenui.com/components/select/)

Page: https://unseenui.com/components/slider/
