---
title: Slider
description: An input where the user selects a value from within a given range.

link:
  doc: https://kobalte.dev/docs/core/components/slider
  api: https://kobalte.dev/docs/core/components/slider#api-reference
---

<ComponentPreview name="slider-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/slider-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/slider" file=<rootDir>/apps/docs/src/registry/ui/slider.tsx

    ```

    ```tsx title="components/ui/slider" file=<rootDir>/apps/unocss-playground/src/registry/ui/slider.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import {
  Slider,
  SliderFill,
  SliderThumb,
  SliderTrack,
} from "@components/ui/slider"
```

```tsx
<Slider>
  <SliderTrack>
    <SliderFill />
    <SliderThumb />
  </SliderTrack>
</Slider>
```

## Examples

### Vertical

<ComponentPreview name="slider-vertical-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/slider-vertical-demo.tsx

```

</ComponentPreview>

### Custom Label

<ComponentPreview name="slider-custom-label-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/slider-custom-label-demo.tsx

```

</ComponentPreview>
