crucıble

Press

A variable-font pressure headline — the line behaves as a press bed under the cursor: glyph weight swells with a gaussian falloff while nearby letters rise and letter-spacing opens around the pressure point. Idle, the weight axis breathes almost imperceptibly. Pure rAF over font-variation-settings; real text in the DOM, static mid-weight under reduced motion; a ghost pressure point sweeps the line when untouched.

cssfree

Installation

CLI

npx shadcn@latest add @crucible/press

Props

PropTypeDefaultDescription
childrenstringThe headline text. Server-renders as plain text; the effect attaches after hydration.
minWeightnumber320Resting font weight for untouched glyphs.
maxWeightnumber900Font weight a glyph reaches directly under the cursor.
radiusnumber160Radius in px of the pressure field around the cursor.
liftnumber6How far, in px, glyphs near the cursor rise off the baseline.
spreadnumber0.06How far, in em, letter-spacing opens around the pressure point.
fontFamilystringvariable system-ui stackFont stack. Must expose a variable wght axis for the swell to render; the default system stack is variable on every modern platform.
pausedbooleanfalseFreeze the pressure field (and the idle breathing).
idlebooleantrueIdle autoplay: when the cursor hasn't moved for 1.5s (or isn't over the page) and isn't pressing the line, a ghost pressure point sweeps slowly back and forth along the headline at reduced strength. A real pointer takes over instantly. Off under reduced motion / coarse pointers.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"span">, "children"> — they pass through to the underlying element.

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