Skip to main content
Clever Ops

Orrery Crank

A hand-cranked orrery for React, turn the crank and geared planets advance at true period ratios while you hunt conjunctions on a mono day readout. ARIA slider, Tailwind tokens.

Preview & code

Loading Orrery Crank preview

Installation

pnpm dlx shadcn@latest add @cleverui/orrery-crank

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

Usage

tsx
import { OrreryCrank } from '@/components/ui/orrery-crank'
Exampletsx
import { OrreryCrank } from '@/components/ui/orrery-crank'

export default function OrreryCrankDemo() {
  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 · ephemeris instrument
      </p>
      <h2 className="mb-6 text-2xl font-semibold tracking-tight text-balance sm:text-3xl">
        Crank time until two worlds align.
      </h2>
      <OrreryCrank
        periods={[88, 225, 365]}
        defaultDay={214}
        daysPerTurn={30}
        caption="ORRERY · 1 TURN = 30 DAYS"
        ariaLabel="Hand-cranked orrery"
      />
      <p className="mt-4 text-sm leading-relaxed text-muted-foreground">
        Drag the crank, or tab to it and use arrows, to scrub days. Periods
        stay ratio-true; a conjunction lights when any pair closes within four
        degrees.
      </p>
    </div>
  )
}

API reference

OrreryCrank accepts the following props.

PropTypeDefaultDescription
periodsnumber[]orbital periods in days for 2-4 planets
defaultDaynumber0day shown on first render (clamped 0-730; SSR-rendered composed)
daysPerTurnnumber30crank gearing, days advanced per full crank revolution
captionstring'ORRERY · 1 TURN = 30 DAYS'mono micro-label on the panel
ariaLabelstring'Hand-cranked orrery'accessible name for the crank slider

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

Frequently asked questions

How do I install the Orrery Crank component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/orrery-crank`. 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 Orrery Crank require?

Orrery Crank 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 Orrery Crank 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