📄 radixui/themes/docs/components/slider

File: slider.md | Updated: 11/15/2025

Source: https://www.radix-ui.com/themes/docs/components/slider

Radix Homepage

Made by WorkOS

Radix Homepage

Made by WorkOS

ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors

Documentation Playground Blog

Overview

Getting started Styling Layout Releases Resources

Theme

Overview Color Dark mode Typography Spacing Breakpoints Radius Shadows Cursors

Layout

Box Flex Grid Container Section

Typography

Text Heading Blockquote Code Em Kbd Link Quote Strong

Components

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

Utilities

Accessible Icon Portal Reset Slot Theme Visually Hidden

Components

Slider

Provides user selection from a range of values.

View source Report an issue View in Playground

<Slider defaultValue={[50]} />

API Reference


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 |

Examples


Size

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>

Variant

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>

Color

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>

High-contrast

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>

Radius

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>

Range

Provide multiple values to create a range slider.

<Slider defaultValue={[25, 75]} />

PreviousSkeleton

NextSpinner

Edit this page on GitHub.