Components

Binary Rain

A binary rain background for React: columns of falling 0s and 1s with bright heads, fading trails and flickering glyphs, drawn on a high-DPI canvas. A fast, accessible take on the classic hacker effect for heroes, login screens and 404 pages.

  • Background
  • Canvas
  • High-DPI
  • Pauses off-screen
  • Reduced-motion safe

Welcome back

Your last build finished 4 minutes ago.

Installation

$ npx shadcn@latest add https://duskui.com/r/binary-rain.json

The rain fills its nearest positioned parent. A radial gradient of var(--color-background) behind your text keeps it readable.

Usage

not-found.tsx
import { BinaryRain } from "@/components/dusk/techy/binary-rain"

export default function NotFound() {
  return (
    <main className="relative grid min-h-svh place-items-center overflow-hidden">
      <BinaryRain />
      <h1 className="relative text-4xl font-bold">404</h1>
    </main>
  )
}

Examples

Colors, sizes & characters

Tune fontSize, speed and density, or rain any glyphs with characters — hex, katakana, emoji.

fontSize=18 · speed=0.6
characters="0–F"

Behind a form

Keep it calm behind interactive UI: a low density, a slower speed and some opacity. The form stays fully clickable.

Sign in to your workspace

API Reference

Any other div prop is passed to the root.

PropTypeDefaultDescription
colorstring"var(--color-primary)"Glyph color. Any CSS color, including variables and oklch().
fontSizenumber14Glyph size in px; also the column width.
speednumber1Fall speed multiplier.
densitynumber0.4Share of columns raining at once, from 0 to 1.
charactersstring"01"The glyphs to rain.
classNamestring—Merged onto the absolutely positioned root.

Accessibility

  • Decorative only: the root is aria-hidden and pointer-events-none, so the glyphs are never read out.
  • With prefers-reduced-motion a single still frame is drawn instead of the animation.
  • The loop stops while off-screen or in a hidden tab and is cancelled on unmount; glyphs are pre-rendered once so each frame is cheap.
  • Rapidly flickering content can be distracting — keep density low behind long-form text.