Back to Shark UI

Circular Slider

docs/components/circular-slider

latest7.0 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Circular Slider

Copy Markdown

Circular slider for selecting values.

DocsAPI

PreviewCode

45 °

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/circular-slider

Usage#

import { CircularSlider } from "@/components/ui/circular-slider";
<CircularSlider defaultValue={45} />

Controlled#

PreviewCode

More than: 180

States#

Disabled#

PreviewCode

Examples#

Size#

Use the size prop to change the slider dimensions.

PreviewCode

Thickness#

Use the thickness prop to change the progress ring thickness.

PreviewCode

With markers#

Use markers to display clock-style tick marks.

PreviewCode

With step#

Use markersAtSteps with step to align markers with step positions.

PreviewCode

Show value#

Use CircularSliderValue to show the current value. The prefix and suffix props customize the display.

PreviewCode

90 °

Custom markers#

Pass a number[] to markers for custom angles.

PreviewCode

API Reference#

CircularSlider#

Root component. Manages angle selection and value.

PropTypeDefault
valuenumber-
defaultValuenumber0
onValueChange(details: ValueChangeDetails) => void-
stepnumber1
disabledboolean-
sizenumber120
thicknessnumber6
markers`booleannumber[]`
markersAtStepsbooleanfalse
classNamestring-

CircularSliderValue#

Shows the current angle value (degrees or custom format).

PropTypeDefault
prefix`React.ReactNodestring`
suffix`React.ReactNodestring`
classNamestring-

For a complete list of props, see the Ark UI documentation.

[

Previous page

Circular Progress ](/docs/components/circular-progress)[

Next page

Clipboard ](/docs/components/clipboard)

On This Page

InstallationUsageControlledStatesDisabledExamplesSizeThicknessWith markersWith stepShow valueCustom markersAPI ReferenceCircularSliderCircularSliderValue