Circular Slider

A radial slider component for selecting values along a circular path

Preview

Installation

npx shadcn@latest add @cubby-ui/circular-slider

Usage

import {
  CircularSliderRoot,
  CircularSliderTrack,
  CircularSliderIndicator,
  CircularSliderThumb,
} from "@/components/ui/cubby-ui/circular-slider";
<CircularSliderRoot>
  <CircularSliderTrack />
  <CircularSliderIndicator />
  <CircularSliderThumb />
</CircularSliderRoot>

Examples

With Value Display

Display the current value in the center of the slider.

75

Sizes

Configure the slider size and independently control track, indicator, and thumb dimensions.

60
60
60

Variants

Choose between a classic ring style or a filled circle with a radial indicator.

70

Default

93

Filled

Format Value

Customize the displayed value with custom formatting like units or symbols.

72°F

Temperature

180°

Angle

65%

Percentage

With Markers

Add visual markers around the circle for better value indication.

4h

Direction

Control the direction of value progression around the circle.

75

Clockwise (default)

75

Counterclockwise

Non-Continuous Mode

Disable continuous mode to show a visual gap and prevent wrapping from max to min.

350°

Continuous (default)

270°

Non-continuous (has gap)

Custom Start Angle

Configure where the slider starts on the circle.

50

Start: 0° (top)

50

Start: 90° (right)

50

Start: 270° (left)

API Reference

The Circular Slider is a custom component built with SVG and follows the established patterns from Base UI components (using useRender and mergeProps).

CircularSliderRoot

The root container that manages state and provides context to child components.

Prop

Form & Accessibility

These props are forwarded to an underlying native <input type="range"> for form integration and screen reader support.

Prop

CircularSliderTrack

The background circle or arc that shows the full range.

Prop

CircularSliderIndicator

The arc that shows the selected value range from min to current value.

Prop

CircularSliderThumb

The draggable handle on the circle that controls the value.

Prop

CircularSliderValue

Text display of the current value, typically shown in the center of the circle.

Prop

CircularSliderMarkers

Visual tick marks around the circle for better value indication.

Prop