Skip to content

shadcn.io is not affiliated with official shadcn/ui

Shadcn Circular Slider for React Radix UI

A progress-ring dial for selecting an angle.

Framework
UI library

Radix UI does not include this primitive, so this page uses the Ark UI component. The visuals match the Ark UI version.

45°

Installation

bunx --bun shadcn@latest add https://kit.dev/r/radix/circular-slider.json

Anatomy

CircularSlider
├── CircularSliderLabel
├── CircularSliderThumb
├── CircularSliderValue
├── CircularSliderContext
├── CircularSliderTrack
└── CircularSliderMarker
    └── CircularSliderMarkerGroup

Usage

import {
  CircularSlider,
  CircularSliderValue,
} from "@/components/ui/circular-slider";
<CircularSlider aria-label="Angle" defaultValue={45}>
  <CircularSliderValue suffix="°" />
</CircularSlider>

Accessibility

KeyDescription
ArrowLeft
Decrease the value.
ArrowUp
Decrease the value.
ArrowRight
Increase the value.
ArrowDown
Increase the value.
Home
Go to the start.
End
Go to the end.

Demos

Context

Controlled

Custom Markers

Disabled

Invalid

Read Only

Root Provider

Size

Step

Thickness

With Label

With Markers

With Value

API Reference

CircularSlider

div

PropType
AttributeType
CSS variableType
--anglestring
--valuestring

CircularSliderLabel

label

PropType
AttributeType

CircularSliderThumb

div

PropType
AttributeType
CSS variableType
--sizestring

CircularSliderValue

div

PropType
prefix?ReactNode
suffix?ReactNode
AttributeType

CircularSliderMarkerGroup

div

PropType
AttributeType

CircularSliderMarker

div

PropType
AttributeType
CSS variableType
--marker-display-valuestring
--marker-heightstring
--marker-offsetstring
--marker-valuestring
--marker-widthstring

CircularSliderRootProvider

div

PropType
AttributeType
CSS variableType
--anglestring
--valuestring

useCircularSlider

CircularSliderContext