···11+---
22+title: Slider
33+description: A range input component for selecting values within a specified range.
44+---
55+66+import { PropDocs } from '../../lib/PropDocs'
77+import { Example } from '../../lib/Example'
88+import { Basic } from '../../examples/slider/basic'
99+import { Range } from '../../examples/slider/range'
1010+import { WithLabels } from '../../examples/slider/with-labels'
1111+1212+<Example src={Basic} />
1313+1414+## Installation
1515+1616+Run the following command to add the slider component to your project.
1717+1818+```bash
1919+pnpm hip install slider
2020+```
2121+2222+## Props
2323+2424+This component is built using the [React Aria Slider](https://react-spectrum.adobe.com/react-aria/Slider.html).
2525+2626+<PropDocs components={["Slider"]} />
2727+2828+## Features
2929+3030+### Basic Usage
3131+3232+The slider component allows users to select a single value within a specified range.
3333+3434+<Example src={Basic} />
3535+3636+### Range Selection
3737+3838+For selecting a range of values, provide an array as the `defaultValue` prop.
3939+4040+<Example src={Range} />
4141+4242+### With Labels
4343+4444+Add descriptive labels to slider thumbs using the `thumbLabels` prop for better accessibility.
4545+4646+<Example src={WithLabels} />
4747+4848+## Accessibility
4949+5050+The slider component includes built-in accessibility features:
5151+5252+- **Keyboard Navigation**: Use arrow keys to adjust values
5353+- **Screen Reader Support**: Proper ARIA labels and announcements
5454+- **Focus Management**: Clear focus indicators
5555+- **Value Announcements**: Current values are announced to screen readers
5656+5757+## Usage Examples
5858+5959+### Volume Control
6060+6161+```tsx
6262+<Slider
6363+ label="Volume"
6464+ defaultValue={50}
6565+ minValue={0}
6666+ maxValue={100}
6767+ step={1}
6868+/>
6969+```
7070+7171+### Price Range Selector
7272+7373+```tsx
7474+<Slider
7575+ label="Price Range"
7676+ defaultValue={[20, 80]}
7777+ minValue={0}
7878+ maxValue={100}
7979+ step={5}
8080+ thumbLabels={['Min', 'Max']}
8181+/>
8282+```
8383+8484+### Temperature Control
8585+8686+```tsx
8787+<Slider
8888+ label="Temperature"
8989+ defaultValue={75}
9090+ minValue={0}
9191+ maxValue={100}
9292+ step={1}
9393+ thumbLabels={['Temperature']}
9494+/>
9595+```
9696+9797+## Related Components
9898+9999+- [NumberField](/docs/components/number-field) - For precise numeric input
100100+- [RangeSlider](/docs/components/range-slider) - For dual-handle range selection
101101+- [Switch](/docs/components/switch) - For binary on/off controls
102102+- [Checkbox](/docs/components/checkbox) - For boolean selections