File: slider.md | Updated: 11/15/2025
ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors
Getting started Styling Layout Releases Resources
Overview Color Dark mode Typography Spacing Breakpoints Radius Shadows Cursors
Box Flex Grid Container Section
Text Heading Blockquote Code Em Kbd Link Quote Strong
Alert Dialog Aspect Ratio Avatar Badge Button Callout Card Checkbox Checkbox Group Checkbox Cards Context Menu Data List Dialog Dropdown Menu Hover Card Icon Button Inset Popover Progress Radio Radio Group Radio Cards Scroll Area Segmented Control Select Separator Skeleton Slider Spinner Switch Table Tabs Tab Nav Text Area Text Field Tooltip
Accessible Icon Portal Reset Slot Theme Visually Hidden
Components
Provides user selection from a range of values.
View source Report an issue View in Playground
<Slider defaultValue={[50]} />
This component inherits props from the Slider primitive and supports common margin props .
| Prop | Type | Default |
| --- | --- | --- |
| size | Responsive<"1" \| "2" \| "3"> | "2" |
| variant<br><br>Prop description | "classic" \| "surface" \| "soft" | "surface" |
| color<br><br>Prop description | enum<br><br>See full type | No default value |
| highContrast<br><br>Prop description | boolean | No default value |
| radius<br><br>Prop description | "none" \| "small" \| "medium" \| "large" \| "full" | No default value |
Use the size prop to control the size.
<Flex direction="column" gap="4" maxWidth="300px">
<Slider defaultValue={[25]} size="1" />
<Slider defaultValue={[50]} size="2" />
<Slider defaultValue={[75]} size="3" />
</Flex>
Use the variant prop to control the visual style.
<Flex direction="column" gap="4" maxWidth="300px">
<Slider defaultValue={[25]} variant="surface" />
<Slider defaultValue={[50]} variant="classic" />
<Slider defaultValue={[75]} variant="soft" />
</Flex>
Use the color prop to assign a specific color
.
<Flex direction="column" gap="4" maxWidth="300px">
<Slider defaultValue={[20]} color="indigo" />
<Slider defaultValue={[40]} color="cyan" />
<Slider defaultValue={[60]} color="orange" />
<Slider defaultValue={[80]} color="crimson" />
</Flex>
Use the highContrast prop to increase color contrast in light mode.
<Grid columns="2" gap="4">
<Slider defaultValue={[10]} color="indigo" />
<Slider defaultValue={[10]} color="indigo" highContrast />
<Slider defaultValue={[30]} color="cyan" />
<Slider defaultValue={[30]} color="cyan" highContrast />
<Slider defaultValue={[50]} color="orange" />
<Slider defaultValue={[50]} color="orange" highContrast />
<Slider defaultValue={[70]} color="crimson" />
<Slider defaultValue={[70]} color="crimson" highContrast />
<Slider defaultValue={[90]} color="gray" />
<Slider defaultValue={[90]} color="gray" highContrast />
</Grid>
Use the radius prop to assign a specific radius value.
<Flex direction="column" gap="4" maxWidth="300px">
<Slider defaultValue={[25]} radius="none" />
<Slider defaultValue={[50]} radius="small" />
<Slider defaultValue={[75]} radius="full" />
</Flex>
Provide multiple values to create a range slider.
<Slider defaultValue={[25, 75]} />
PreviousSkeleton
NextSpinner