crucıble

Phosphor

A themed panel styled as a monochrome CRT monitor: a dark vignetted screen with glowing selectable monospace text, fine scanlines, a slow refresh-bar roll, and a blinking block caret. The built-in switcher recoats the tube between amber, green, and paper-white phosphor. Pure CSS; reduced motion holds a steady glow.

cssfree

Installation

CLI

npx shadcn@latest add @crucible/phosphor

Props

PropTypeDefaultDescription
phosphorPhosphorColorControlled phosphor coating. Pair with onPhosphorChange.
defaultPhosphorPhosphorColor"amber"Initial phosphor when uncontrolled.
onPhosphorChange(phosphor: PhosphorColor) => voidFires with the next coating whenever the switcher changes it.
switcherbooleantrueRender the built-in amber / green / white switcher strip.
childrenReact.ReactNodeTerminal content. Falls back to a boot readout when omitted.
caretbooleantrueShow the blinking block caret after the content.
intensitynumber1Scanline + vignette strength, 0–1.
speednumber1Blink / flicker / roll rate multiplier.
pausedbooleanfalseFreeze all motion — steady glow, solid caret, no flicker.
colorsPartial<Record<PhosphorColor, string>>Override the three phosphor text hues (any CSS hex color).
switcherLabelstring"Phosphor coating"Accessible label for the switcher radiogroup.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "color">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.