Skip to content
Sign upGet access
MicrointeractionsEffort dialMenu

Effort dial

Reasoning effort on a knob: it follows the pointer, settles into the nearest detent on a spring, lights an arc and rolls the level's name like a drum.

Turn the knob in the composer: it follows the pointer, settles into a detent, and the word under it rolls to the new level.

A knob says what a segmented control cannot: that effort is a quantity, more or less of the same thing. Turn it and it follows your pointer round its axis, the arc lighting to where it points; let go and a critically damped spring settles it into the nearest detent. The level's name rolls with the knob like a drum, so the word moves as much as the knob did.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/effort-dial.json

Usage

tsx
import { EffortDial } from "@/components/ui/chatcn/effort-dial"

<EffortDial value={effort} onValueChange={setEffort} />

Props

PropTypeNotes
options{ value, label, description? }[]Default Low, Medium, High, Max
value / defaultValuestringControlled or uncontrolled
onValueChange(value: string) => voidFires as the knob passes each detent
labelstringShown above the value and used as the accessible name. Default "Effort"
disabledboolean

Keyboard

KeyAction
ArrowRight / ArrowUpNext level
ArrowLeft / ArrowDownPrevious level
Home / EndFirst or last level

Accessibility

  • role="slider" with the level and its description as aria-valuetext.
  • Keys move it instantly: nothing a keyboard triggers animates.
  • On phones each detent gives a 4 ms vibration where the browser supports it.

Motion

  • One spring drives the knob angle, the lit arc and the drum, written straight to styles each frame, so React does not re-render during a turn.
  • The dead zone at the bottom holds the end you came from, so the knob never flips across it.

Under reduced motion: the knob and drum jump to each detent.