# Slider

URL: https://ark-ui.com/docs/react/components/slider
Markdown: https://ark-ui.com/docs/react/components/slider.md

A control element that allows for a range of selections.

---

---
id: slider
title: Slider
description: A control element that allows for a range of selections.
---



## Anatomy



```tsx
<Slider.Root>
  <Slider.Label />
  <Slider.ValueText />
  <Slider.Control>
    <Slider.Track>
      <Slider.Range />
    </Slider.Track>
    <Slider.Thumb>
      <Slider.HiddenInput />
    </Slider.Thumb>
  </Slider.Control>
  <Slider.MarkerGroup>
    <Slider.Marker />
  </Slider.MarkerGroup>
</Slider.Root>
```

## Examples

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const Basic = () => {
  return (
    <Slider.Root className={styles.Root} defaultValue={[40]}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Range

Render multiple `Slider.Thumb` parts for a range slider.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const Range = () => {
  return (
    <Slider.Root defaultValue={[30, 60]} className={styles.Root}>
      <Slider.Label className={styles.Label}>Label</Slider.Label>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
        <Slider.Thumb index={1} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Marks

Add marks with `Slider.MarkerGroup` and `Slider.Marker`. Each marker's `value` sets its position on the track.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const WithMarks = () => {
  return (
    <Slider.Root className={styles.Root} defaultValue={[50]}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
      <Slider.MarkerGroup className={styles.MarkerGroup}>
        {[0, 25, 50, 75, 100].map((value) => (
          <Slider.Marker key={value} value={value} className={styles.Marker}>
            {value}
          </Slider.Marker>
        ))}
      </Slider.MarkerGroup>
    </Slider.Root>
  )
}
```

### Min and Max

Set `min` and `max` to change the bounds. They default to `0` and `100`. This example accepts `-10` to `10`.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const MinMax = () => {
  return (
    <Slider.Root min={-10} max={10} defaultValue={[5]} className={styles.Root}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Granularity

`step` sets the granularity. It defaults to `1`, so values are integers. This example sets `step` to `0.01` for a value
between `5` and `10` with two decimal places.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const Step = () => {
  return (
    <Slider.Root step={0.01} min={5} max={10} defaultValue={[7.5]} className={styles.Root}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Change Events

`onValueChange` fires as the value changes. `onValueChangeEnd` fires when the interaction ends.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const OnEvent = () => {
  return (
    <Slider.Root
      onValueChange={(details) => console.log('onValueChange', details.value)}
      onValueChangeEnd={(details) => console.log('onValueChangeEnd', details.value)}
      className={styles.Root}
    >
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Orientation

Set `orientation="vertical"` for a vertical slider. The up and down arrow keys then change the value.

> Give the vertical slider a height in your styles.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const Vertical = () => {
  return (
    <Slider.Root orientation="vertical" className={styles.Root}>
      <Slider.Label className={styles.Label}>Label</Slider.Label>
      <Slider.ValueText className={styles.ValueText} />
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Origin

The origin defaults to the start of the track. Set `origin` to `center` to start from the middle.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const CenterOrigin = () => {
  return (
    <Slider.Root origin="center" className={styles.Root} defaultValue={[75]}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Root Provider

Use `RootProvider` with the `useSlider` hook to access the state and methods from outside the component.

```tsx
import { Slider, useSlider } from '@ark-ui/react/slider'
import button from 'styles/button.module.css'
import styles from 'styles/slider.module.css'

export const RootProvider = () => {
  const slider = useSlider()

  return (
    <>
      <button className={button.Root} onClick={() => slider.focus()}>
        Focus
      </button>

      <Slider.RootProvider value={slider} className={styles.Root}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
        <Slider.Control className={styles.Control}>
          <Slider.Track className={styles.Track}>
            <Slider.Range className={styles.Range} />
          </Slider.Track>
          <Slider.Thumb index={0} className={styles.Thumb}>
            <Slider.HiddenInput />
          </Slider.Thumb>
        </Slider.Control>
      </Slider.RootProvider>
    </>
  )
}
```

### Dragging Indicator

Place `Slider.DraggingIndicator` inside `Slider.Thumb` to show an indicator while dragging.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const DraggingIndicator = () => {
  return (
    <Slider.Root className={styles.Root} defaultValue={[40]}>
      <Slider.Label className={styles.Label}>Label</Slider.Label>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.DraggingIndicator className={styles.DraggingIndicator} />
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### With Tooltip

Render the thumb as a tooltip trigger to show the current value on hover, focus and drag.

```tsx
import { Portal } from '@ark-ui/react/portal'
import { Slider } from '@ark-ui/react/slider'
import { Tooltip } from '@ark-ui/react/tooltip'
import { useId, useState } from 'react'
import styles from 'styles/slider.module.css'
import tooltip from 'styles/tooltip.module.css'

export const WithTooltip = () => {
  const thumbId = useId()
  const [open, setOpen] = useState(false)

  return (
    <Slider.Root className={styles.Root} defaultValue={[40]} ids={{ thumb: () => thumbId }}>
      <Slider.Label className={styles.Label}>Volume</Slider.Label>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Context>
          {(slider) => (
            <Tooltip.Root
              ids={{ trigger: thumbId }}
              open={open || slider.dragging}
              onOpenChange={(details) => setOpen(details.open)}
              openDelay={0}
              closeOnClick={false}
              closeOnPointerDown={false}
              positioning={{ placement: 'top' }}
            >
              <Tooltip.Trigger
                render={
                  <Slider.Thumb index={0} className={styles.Thumb}>
                    <Slider.HiddenInput />
                  </Slider.Thumb>
                }
              />
              <Portal>
                <Tooltip.Positioner className={tooltip.Positioner}>
                  <Tooltip.Content className={tooltip.Content}>{slider.value[0]}</Tooltip.Content>
                </Tooltip.Positioner>
              </Portal>
            </Tooltip.Root>
          )}
        </Slider.Context>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### With Number Input

Sync a range slider with number inputs so either one can set the value.

```tsx
import { NumberInput } from '@ark-ui/react/number-input'
import { Slider } from '@ark-ui/react/slider'
import { useState } from 'react'
import numberInput from 'styles/number-input.module.css'
import styles from 'styles/slider.module.css'

const min = 0
const max = 1000
const step = 10
const minStepsBetweenThumbs = 5
const gap = step * minStepsBetweenThumbs

export const WithNumberInput = () => {
  const [value, setValue] = useState<(number | null)[]>([200, 600])
  const start = value[0] ?? min
  const end = value[1] ?? max

  const setValueAt = (index: number, next: number | null) => {
    setValue((prev) => prev.map((v, i) => (i === index ? next : v)))
  }

  return (
    <div className="stack">
      <Slider.Root
        className={styles.Root}
        min={min}
        max={max}
        step={step}
        minStepsBetweenThumbs={minStepsBetweenThumbs}
        value={[Math.min(Math.max(start, min), max - gap), Math.min(Math.max(end, start + gap), max)]}
        onValueChange={(details) => setValue(details.value)}
        getAriaLabel={({ index }) => (index === 0 ? 'Minimum price' : 'Maximum price')}
      >
        <Slider.Label className={styles.Label}>Price range</Slider.Label>
        <Slider.Control className={styles.Control}>
          <Slider.Track className={styles.Track}>
            <Slider.Range className={styles.Range} />
          </Slider.Track>
          <Slider.Thumb index={0} className={styles.Thumb}>
            <Slider.HiddenInput />
          </Slider.Thumb>
          <Slider.Thumb index={1} className={styles.Thumb}>
            <Slider.HiddenInput />
          </Slider.Thumb>
        </Slider.Control>
      </Slider.Root>
      <div className={styles.NumberInputs}>
        <NumberInput.Root
          className={numberInput.Root}
          value={value[0]}
          min={min}
          max={end - gap}
          step={step}
          onValueChange={(details) => setValueAt(0, details.value)}
        >
          <NumberInput.Label className={numberInput.Label}>Min</NumberInput.Label>
          <NumberInput.Control className={numberInput.Control}>
            <NumberInput.Input className={numberInput.Input} />
          </NumberInput.Control>
        </NumberInput.Root>
        <NumberInput.Root
          className={numberInput.Root}
          value={value[1]}
          min={start + gap}
          max={max}
          step={step}
          onValueChange={(details) => setValueAt(1, details.value)}
        >
          <NumberInput.Label className={numberInput.Label}>Max</NumberInput.Label>
          <NumberInput.Control className={numberInput.Control}>
            <NumberInput.Input className={numberInput.Input} />
          </NumberInput.Control>
        </NumberInput.Root>
      </div>
    </div>
  )
}
```

### Thumb Overlap

Set `minStepsBetweenThumbs` to keep a minimum gap between range thumbs, as in a price filter.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const ThumbOverlap = () => {
  return (
    <Slider.Root minStepsBetweenThumbs={5} defaultValue={[25, 60]} className={styles.Root}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
        <Slider.Thumb index={1} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

### Thumb Collision

`thumbCollisionBehavior` sets what happens when thumbs collide while dragging: `push` (default), `swap` or `none`.

```tsx
import { Slider } from '@ark-ui/react/slider'
import styles from 'styles/slider.module.css'

export const ThumbCollision = () => {
  return (
    <Slider.Root thumbCollisionBehavior="push" defaultValue={[25, 60]} className={styles.Root}>
      <div style={{ display: 'flex', justifyContent: 'space-between' }}>
        <Slider.Label className={styles.Label}>Label</Slider.Label>
        <Slider.ValueText className={styles.ValueText} />
      </div>
      <Slider.Control className={styles.Control}>
        <Slider.Track className={styles.Track}>
          <Slider.Range className={styles.Range} />
        </Slider.Track>
        <Slider.Thumb index={0} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
        <Slider.Thumb index={1} className={styles.Thumb}>
          <Slider.HiddenInput />
        </Slider.Thumb>
      </Slider.Control>
    </Slider.Root>
  )
}
```

## API Reference

### Props

### Root

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`defaultValue`**
Type: `number[]`
Required: false
Default Value: `undefined`
Description: The initial value of the slider when rendered.
Use when you don't need to control the value of the slider.

**`disabled`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Whether the slider is disabled

**`form`**
Type: `string`
Required: false
Default Value: `undefined`
Description: The associate form of the underlying input element.

**`getAriaLabel`**
Type: `(details: ThumbLabelDetails) => string`
Required: false
Default Value: `undefined`
Description: Function that returns the accessible name of each thumb, e.g. "Minimum price"

**`getAriaLabelledBy`**
Type: `(details: ThumbLabelDetails) => string`
Required: false
Default Value: `undefined`
Description: Function that returns the `id` of the element that labels each thumb.
Defaults to the label part when no `getAriaLabel` is provided.

**`getAriaValueText`**
Type: `(details: ValueTextDetails) => string`
Required: false
Default Value: `undefined`
Description: Function that returns a human readable value for the slider thumb

**`id`**
Type: `string`
Required: false
Default Value: `undefined`
Description: The unique identifier of the machine.

**`ids`**
Type: `ElementIds`
Required: false
Default Value: `undefined`
Description: The ids of the elements in the slider. Useful for composition.

**`invalid`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Whether the slider is invalid

**`largeStep`**
Type: `number`
Required: false
Default Value: `10 * step`
Description: The step value of the slider when the `Shift` key is held, or the
`PageUp`/`PageDown` keys are used.

**`max`**
Type: `number`
Required: false
Default Value: `100`
Description: The maximum value of the slider

**`min`**
Type: `number`
Required: false
Default Value: `0`
Description: The minimum value of the slider

**`minStepsBetweenThumbs`**
Type: `number`
Required: false
Default Value: `0`
Description: The minimum permitted steps between multiple thumbs.

`minStepsBetweenThumbs` * `step` should reflect the gap between the thumbs.

- `step: 1` and `minStepsBetweenThumbs: 10` => gap is `10`
- `step: 10` and `minStepsBetweenThumbs: 2` => gap is `20`

**`name`**
Type: `string`
Required: false
Default Value: `undefined`
Description: The name associated with each slider thumb (when used in a form)

**`onFocusChange`**
Type: `(details: FocusChangeDetails) => void`
Required: false
Default Value: `undefined`
Description: Function invoked when the slider's focused index changes

**`onValueChange`**
Type: `(details: ValueChangeDetails) => void`
Required: false
Default Value: `undefined`
Description: Function invoked when the value of the slider changes

**`onValueChangeEnd`**
Type: `(details: ValueChangeDetails) => void`
Required: false
Default Value: `undefined`
Description: Function invoked when the slider value change is done

**`orientation`**
Type: `'horizontal' | 'vertical'`
Required: false
Default Value: `"horizontal"`
Description: The orientation of the slider

**`origin`**
Type: `SliderOrigin`
Required: false
Default Value: `"start"`
Description: The origin of the slider range. The track is filled from the origin to the thumb.
- `"start"` / `"end"`: fill from `min` / `max`
- `"center"`: fill from the midpoint of `min`/`max`
- a `number`: fill from that value instead, for when the neutral point isn't the midpoint

**`readOnly`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Whether the slider is read-only

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<SliderRootState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

**`step`**
Type: `number`
Required: false
Default Value: `1`
Description: The step value of the slider

**`thumbAlignment`**
Type: `'center' | 'contain'`
Required: false
Default Value: `"contain"`
Description: The alignment of the slider thumb relative to the track
- `center`: the thumb will extend beyond the bounds of the slider track.
- `contain`: the thumb will be contained within the bounds of the track.

**`thumbCollisionBehavior`**
Type: `'none' | 'push' | 'swap'`
Required: false
Default Value: `"none"`
Description: Controls how thumbs behave when they collide during pointer interactions.
- `none` (default): Thumbs cannot move past each other; excess movement is ignored.
- `push`: Thumbs push each other without restoring their previous positions when dragged back.
- `swap`: Thumbs swap places when dragged past each other.

**`thumbSize`**
Type: `number | { width: number; height: number }`
Required: false
Default Value: `undefined`
Description: The slider thumbs dimensions. A number sets both the width and height.

**`value`**
Type: `number[]`
Required: false
Default Value: `undefined`
Description: The controlled value of the slider

#### Data Attributes

**`data-slider-root`**: <uid>
**`data-disabled`**: Present when disabled
**`data-orientation`**: The orientation of the slider
**`data-dragging`**: Present when in the dragging state
**`data-invalid`**: Present when invalid
**`data-focus`**: Present when focused

### Control

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-control`**: <uid>
**`data-disabled`**: Present when disabled
**`data-orientation`**: The orientation of the control
**`data-dragging`**: Present when in the dragging state
**`data-invalid`**: Present when invalid
**`data-focus`**: Present when focused

### DraggingIndicator

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-dragging-indicator`**: <uid>
**`data-orientation`**: The orientation of the draggingindicator
**`data-state`**: "open" | "closed"

### HiddenInput

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

### Label

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-label`**: <uid>
**`data-disabled`**: Present when disabled
**`data-orientation`**: The orientation of the label
**`data-dragging`**: Present when in the dragging state
**`data-invalid`**: Present when invalid
**`data-focus`**: Present when focused

### MarkerGroup

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-marker-group`**: <uid>
**`data-orientation`**: The orientation of the markergroup

### Marker

#### Props

**`value`**
Type: `number`
Required: true
Default Value: `undefined`
Description: undefined

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<SliderMarkerState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-marker`**: <uid>
**`data-orientation`**: The orientation of the marker
**`data-value`**: The value of the item
**`data-disabled`**: Present when disabled
**`data-state`**: "under-value" | "over-value" | "at-value"
**`data-in-range`**: Present when is within the range

### Range

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-range`**: <uid>
**`data-disabled`**: Present when disabled
**`data-orientation`**: The orientation of the range
**`data-dragging`**: Present when in the dragging state
**`data-invalid`**: Present when invalid
**`data-focus`**: Present when focused

### RootProvider

#### Props

**`value`**
Type: `UseSliderReturn`
Required: true
Default Value: `undefined`
Description: undefined

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<SliderRootProviderState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

### Thumb

#### Props

**`index`**
Type: `number`
Required: true
Default Value: `undefined`
Description: undefined

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`disabled`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: undefined

**`name`**
Type: `string`
Required: false
Default Value: `undefined`
Description: undefined

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<SliderThumbState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-thumb`**: <uid>
**`data-index`**: The index of the item
**`data-name`**: 
**`data-disabled`**: Present when disabled
**`data-invalid`**: Present when invalid
**`data-orientation`**: The orientation of the thumb
**`data-focus`**: Present when focused
**`data-dragging`**: Present when in the dragging state

### Track

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-track`**: <uid>
**`data-disabled`**: Present when disabled
**`data-orientation`**: The orientation of the track
**`data-dragging`**: Present when in the dragging state
**`data-invalid`**: Present when invalid
**`data-focus`**: Present when focused

### ValueText

#### Props

**`asChild`**
Type: `boolean`
Required: false
Default Value: `undefined`
Description: Use the provided child element as the default rendered element, combining their props and behavior.

Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

**`render`**
Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>`
Required: false
Default Value: `undefined`
Description: Render the part as a custom element, combining their props and behavior.

Pass an element to have the part's props merged into it, or a function to control the merge
yourself and read the part's state.

#### Data Attributes

**`data-slider-value-text`**: <uid>
**`data-disabled`**: Present when disabled
**`data-orientation`**: The orientation of the valuetext
**`data-dragging`**: Present when in the dragging state
**`data-invalid`**: Present when invalid
**`data-focus`**: Present when focused

### Context

**API:**

| Property | Type | Description |
|----------|------|-------------|
| `value` | `number[]` | The value of the slider. |
| `dragging` | `boolean` | Whether the slider is being dragged. |
| `focused` | `boolean` | Whether the slider is focused. |
| `setValue` | `(value: number[]) => void` | Function to set the value of the slider. |
| `getThumbValue` | `(index: number) => number` | Returns the value of the thumb at the given index. |
| `setThumbValue` | `(index: number, value: number) => void` | Sets the value of the thumb at the given index. |
| `getValuePercent` | `(value: number) => number` | Returns the percent of the thumb at the given index. |
| `getPercentValue` | `(percent: number) => number` | Returns the value of the thumb at the given percent. |
| `getThumbPercent` | `(index: number) => number` | Returns the percent of the thumb at the given index. |
| `setThumbPercent` | `(index: number, percent: number) => void` | Sets the percent of the thumb at the given index. |
| `getThumbMin` | `(index: number) => number` | Returns the min value of the thumb at the given index. |
| `getThumbMax` | `(index: number) => number` | Returns the max value of the thumb at the given index. |
| `increment` | `(index: number) => void` | Function to increment the value of the slider at the given index. |
| `decrement` | `(index: number) => void` | Function to decrement the value of the slider at the given index. |
| `focus` | `VoidFunction` | Function to focus the slider. This focuses the first thumb. |
| `getRootState` | `() => RootState` | Returns the state of the slider |
| `getThumbState` | `(props: ThumbProps) => ThumbState` | Returns the state of a specific thumb |
| `getMarkerState` | `(props: MarkerProps) => MarkerState` | Returns the state of a specific marker |


## Accessibility

Complies with the [Slider WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/slider/).

### Keyboard Support

**`ArrowRight`**
Description: <span>Increments the slider based on defined step</span>

**`ArrowLeft`**
Description: <span>Decrements the slider based on defined step</span>

**`ArrowUp`**
Description: <span>Increases the value by the step amount.</span>

**`ArrowDown`**
Description: <span>Decreases the value by the step amount.</span>

**`PageUp`**
Description: <span>Increases the value by the <code>largeStep</code> amount.</span>

**`PageDown`**
Description: <span>Decreases the value by the <code>largeStep</code> amount.</span>

**`Shift + ArrowUp`**
Description: <span>Increases the value by the <code>largeStep</code> amount.</span>

**`Shift + ArrowDown`**
Description: <span>Decreases the value by the <code>largeStep</code> amount.</span>

**`Home`**
Description: Sets the value to its minimum.

**`End`**
Description: Sets the value to its maximum.
