# Slider · JGuang UI

> An input where the user selects a value from within a given range.

- Page: https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider
- Based on: shadcn/ui documentation (MIT) @ bc0705384b51252af26dcc65425b216bf5eb063c

> Example `slider-demo`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## Installation


  

**Command**


  

**Manual**


```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```


### Install the following dependencies:


```bash
npm install radix-ui
```


### Copy and paste the following code into your project.


[View complete source: components/ui/slider.tsx](/r/jguang-ui/radix/slider.json)


### Update the import paths to match your project setup.


## Usage

```tsx
import { Slider } from "@/components/ui/slider"
```

```tsx
<Slider defaultValue={[33]} max={100} step={1} />
```

## Range

Use an array with two values for a range slider.


> Example `slider-range`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## Multiple Thumbs

Use an array with multiple values for multiple thumbs.


> Example `slider-multiple`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## Vertical

Use `orientation="vertical"` for a vertical slider.


> Example `slider-vertical`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## Controlled


> Example `slider-controlled`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## Disabled

Use the `disabled` prop to disable the slider.


> Example `slider-disabled`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## RTL

To enable RTL support in JGuang UI, see the [RTL configuration guide](/systems/jguang-ui/docs/rtl).


> Example `slider-rtl`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/slider


## API Reference

See the [Radix UI Slider](https://www.radix-ui.com/docs/primitives/components/slider#api-reference) documentation.

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
