Skip to main content
Clever Ops

Rotary Tuner

A draggable rotary tuner for React, real angular drag with inertia and detents drives a geared needle while station labels resolve from static. ARIA slider semantics, Tailwind tokens.

Preview & code

Loading Rotary Tuner preview

Installation

pnpm dlx shadcn@latest add @cleverui/rotary-tuner

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { RotaryTuner } from '@/components/ui/rotary-tuner'
Exampletsx
import { RotaryTuner } from '@/components/ui/rotary-tuner'

export default function RotaryTunerDemo() {
  return (
    <div className="mx-auto w-full max-w-3xl px-4 py-10 sm:px-6 sm:py-14">
      <p className="mb-4 font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
        Spectacle · lock a station
      </p>
      <h2 className="mb-6 text-2xl font-semibold tracking-tight text-balance sm:text-3xl">
        Tune until the needle settles.
      </h2>
      <RotaryTuner
        ariaLabel="Nightwave station tuner"
        defaultIndex={1}
        stations={[
          {
            label: 'SIGNAL ONE',
            detail: 'Ambient broadcast · 04:12 remaining on the hour loop.',
          },
          {
            label: 'HARBOR NET',
            detail: 'Shipping forecasts and tide tables for the outer channel.',
          },
          {
            label: 'CARBON 88',
            detail: 'Late-night interview archive · mono feed, no ads.',
          },
          {
            label: 'DRIFT FM',
            detail: 'Long-form field recordings from the northern rail cuts.',
          },
          {
            label: 'APEX BEACON',
            detail: 'Emergency drill channel, test tone every half hour.',
          },
        ]}
      />
    </div>
  )
}

API reference

RotaryTuner accepts the following props.

PropTypeDefaultDescription
stations*RotaryTunerStation[]3–7 stops along the band
defaultIndexnumber0station selected on first render (SSR-rendered locked)
ariaLabelstring'Station tuner'accessible name for the dial slider

…plus everything from React.HTMLAttributes<HTMLDivElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface RotaryTunerStation {
  label: string
  detail?: string
}

Frequently asked questions

How do I install the Rotary Tuner component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/rotary-tuner`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Rotary Tuner require?

Rotary Tuner uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Rotary Tuner to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services