Skip to main content
Clever Ops

Keystroke Cascade

A type-anything React toy, every keystroke drops a physical glyph tile onto a canvas stage to bounce and stack; Enter opens the floor. Keyboard-native, Tailwind-tokened spectacle.

Preview & code

Loading Keystroke Cascade preview

Installation

pnpm dlx shadcn@latest add @cleverui/keystroke-cascade

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

Usage

tsx
import { KeystrokeCascade } from '@/components/ui/keystroke-cascade'
Exampletsx
import { KeystrokeCascade } from '@/components/ui/keystroke-cascade'

export default function KeystrokeCascadeDemo() {
  return (
    <div className="mx-auto w-full max-w-2xl 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 · type into the pile
      </p>
      <h2 className="mb-6 text-2xl font-semibold tracking-tight text-balance sm:text-3xl">
        Every keystroke is a brick.
      </h2>
      <KeystrokeCascade prompt="type anything…" maxTiles={80} seed={11} />
      <p className="mt-4 text-sm leading-relaxed text-muted-foreground">
        Backspace flips the newest tile off the stack. Enter opens the floor hatch
        and drains the wreckage.
      </p>
    </div>
  )
}

API reference

KeystrokeCascade accepts the following props.

PropTypeDefaultDescription
promptstring'type anything…'mono placeholder on the empty input line
maxTilesnumber80live tile cap; oldest fade beyond it (halved on coarse pointers)
seednumber11deterministic spawn jitter and accent rhythm

…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 Keystroke Cascade component?

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

Keystroke Cascade has no npm dependencies beyond React and Tailwind CSS itself, so there is nothing extra to install or keep updated.

Can I theme Keystroke Cascade 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