# Slider

> Picks a number from a range by dragging or with the keyboard.

- Category: [Inputs & forms](https://tarve.dev/docs.md#inputs)
- Import: `import { Slider } from "@tarve/core";`
- Props type: `SliderProps`
- Source: [packages/core/src/controls.ts:117](https://github.com/omarcosr/tarve/blob/main/packages/core/src/controls.ts#L117)

## Usage

```tsx title="Slider.tsx"
import { Slider } from "@tarve/core";

let volume = 40;

<Slider
  label="Volume"
  value={volume}
  min={0}
  max={100}
  step={5}
  onValueChange={(value) => {
    volume = value;
  }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` (required) | `Bindable<number>` | — | A signal moves the thumb as it changes, without a render (a seek bar bound to a media `time`). |
| `disabled` | `boolean` | — |  |
| `label` | `string` | — |  |
| `max` | `number` | `100` |  |
| `min` | `number` | `0` |  |
| `onValueChange` | `(value: number) => void` | — |  |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` |  |
| `step` | `number` | `1` |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="Bindable"
type Bindable<T> = T | Signal<T>;
```

Previous: [Combobox](https://tarve.dev/docs/components/Combobox.md) · Next: [Toggle](https://tarve.dev/docs/components/Toggle.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Slider · Index for agents: https://tarve.dev/llms.txt
