crucıble

Bokeh

Dreamy out-of-focus lights: a parallax field of soft circular light discs — each with a brighter aperture rim — drifting slowly through the dark, sized and layered by depth like night lights through a defocused lens, with a few sharp in-focus specks. 2D canvas with additive blending, seeded PRNG for a deterministic scatter, pauses offscreen, honors prefers-reduced-motion with a still scatter.

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/bokeh

Props

PropTypeDefaultDescription
colorsstring[]["#ffdca8", "#ffe7cf", "#f3e2c4", "#bcd0ff"]Light colors, sampled across the depth field. Defaults to a warm-neutral palette — champagne, soft amber, warm ivory with one cool accent — so it reads like city lights through a defocused lens. Pass any palette; e.g. ["#5eead4", "#818cf8", "#f0abfc"] for a cool jewel look.
densitynumber40Number of light discs in the field. Clamped 8–140.
speednumber1Drift-speed multiplier. 1 = default, 2 = twice as fast.
intensitynumber1Overall brightness / bloom, 0–2.
seednumber1Deterministic seed — the same seed always renders the same scatter.
pausedbooleanfalseFreeze the field at a still, aesthetic scatter.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
Also accepts all props of React.ComponentPropsWithoutRef<"div">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.