---
title: Slider
description: An input where the user selects a value from within a given range.
links:
doc: https://base-ui.com/react/components/slider#api-reference
---
## Preview
## Installation
CLI
Manual
```bash
npx @olyx/cli@latest add slider
```
Install the following dependencies:
```bash
npm install @base-ui/react
```
Copy and paste the following code into your project.
Update the import paths to match your project setup.
## Usage
```tsx
import { Slider } from "@/components/ui/slider"
```
```tsx
```
## API Reference
### Slider
Root component. Styled wrapper for `Slider.Root` from Base UI. Automatically detects range mode when `value` or `defaultValue` is an array.
## Examples
For accessible labelling and validation, prefer using the `Field` component to wrap sliders. See the related example: [Slider field](/ui/docs/components/field#slider-field).
### Range
### Vertical
### Slider with Label and Value