Skip to content
StackD
Rotary dial, the StackD component

Inputs · €7

Rotary dial

A knob you turn by dragging in a circle, with stepped ticks and a rubbery end.

Pay once on Gumroad: the download, plus a licence key for the registry and the MCP server.

Details

Category
Inputs
Plan
Paid, €7 once
Code
React + Tailwind, TypeScript · 238 lines
Files
RotaryDial.tsx
Needs
React and Tailwind only
Agents
MCP server and shadcn registry

About

A knob you turn by dragging in a circle. It follows your finger smoothly while the value and the ring of ticks move in clean steps; let go and it clicks into place with a small overshoot. Past either end it gives a little, like rubber, and springs back. Mouse, touch and keyboard, and it works with screen readers. White and black versions. React + Tailwind, no other libraries. Respects reduced motion.

Install

Once: add the StackD registry to components.json, with the licence key from your receipt in STACKD_LICENSE_KEY (in .env.local):

"registries": {
  "@stackd": {
    "url": "https://www.stackd.codes/r/{name}.json",
    "headers": { "X-License-Key": "${STACKD_LICENSE_KEY}" }
  }
}

With the shadcn CLI:

npx shadcn@latest add @stackd/rotary-dial

Or let your agent add it through the StackD MCP server:

claude mcp add --transport http stackd https://www.stackd.codes/mcp

Prompt for your agent

Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.

Add the StackD Rotary dial component to this project. Use the StackD MCP server: call get_component with { "name": "rotary-dial" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles. It is a paid component: if the server says it needs a licence, tell me where to buy it.

Use

  1. Copy RotaryDial.tsx into your project (for example components/RotaryDial.tsx).
  2. Use it:
import { RotaryDial } from './components/RotaryDial'

<RotaryDial label="Volume" />

<RotaryDial
  theme="dark"
  label="°C"
  min={10}
  max={30}
  step={0.5}
  defaultValue={21}
  format={(n) => n.toFixed(1)}
  color="#BE9344"
/>

To keep the value in your own state:

const [volume, setVolume] = useState(40)

<RotaryDial value={volume} onChange={setVolume} label="Volume" />

In Next.js the file already starts with 'use client'. In other React setups that line does nothing.

Options

PropDefaultWhat it does
valueControlled value. Leave it out and the dial keeps its own
defaultValue40Starting value when not controlled
onChangeCalled with the new value on every step
min / max0 / 100The range
step1Size of each step
label'Volume'Small text under the number. Also used for screen readers
formatString(n)(n) => string, how the number is written
theme'light''light' (white knob) or 'dark' (black knob)
colorink on light, white on darkColour of the lit ticks and the indicator dot
size220Diameter in px

Keyboard

Arrows: one step. Page Up / Page Down: a tenth of the range. Home / End: min / max.

On Android phones each step gives a tiny vibration. iOS doesn't allow it from the web.

Colours from StackD

White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF

Licence

You can use it in personal and commercial projects. Don't resell or share the component on its own.

Made by StackD · stackd.codes