Skip to Content
Kokonut UI

IN-05Inputs

Detent Dial

Rotary knob that clicks from notch to notch and coasts when flicked, built with React and Motion.

Install with
motion

PRONatural Date Input and more like it are in Kokonut UI Pro

Installation

Detent Dial is a free, open-source React component in the Kokonut UI Inputs collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/detent-dial.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/detent-dial

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/detent-dial.tsx.

npm install motion

Usage

import DetentDial from "@/components/kokonutui/detent-dial";

export default function Example() {
  return <DetentDial />;
}

Props

label
stringDefault "Temperature"

Accessible name, also shown inside the knob.

min
numberDefault 16
max
numberDefault 30
step
numberDefault 0.5
defaultValue
numberDefault 21

Initial value when uncontrolled. Double-clicking the knob returns here.

value
number

Controlled value.

onValueChange
(value: number) => void
formatValue
(value: number) => stringDefault (v) => `${v.toFixed(1)}°`

Formats the readout, the end labels and aria-valuetext.

size
numberDefault 240

Diameter in px.

disabled
booleanDefault false
className
string

Extra classes for the root element.

Dependencies

NeedsVersionComes from
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.