crucıble

Haze

A progressive blur edge — stacked backdrop-filter layers with overlapping mask gradients ramp content from sharp to fully blurred through a container or viewport edge, with an optional tint wash. The iOS-style depth idiom for scrolling lists, floating toolbars, and hero bottoms. Pure CSS, zero JS at runtime.

cssfree

Installation

CLI

npx shadcn@latest add @crucible/haze

Props

PropTypeDefaultDescription
edge"top" | "bottom" | "left" | "right""bottom"Which edge the haze clings to — content sharpens away from this edge.
depthnumber128Size of the blur zone in pixels, measured inward from the edge. Clamped to 16–480 — backdrop-filter cost scales with covered area, so shallow zones are both the look and the budget.
blurnumber24Blur ceiling in pixels reached at the deepest point of the zone. Clamped to 0.5–96.
layersnumber6Number of stacked backdrop layers building the ramp. More layers = a finer blur gradient (and more compositing work). Clamped to 3–12; the default is tuned so no banding seam shows at any DPR.
curvenumber1Easing exponent applied to the ramp's gradient stops. 1 distributes the ramp evenly through the zone; > 1 holds sharpness longer before a steeper dive at the edge; < 1 starts hazing sooner. Clamped to 0.25–4.
tintstring"#050508"Tint color washed toward the edge on top of the blur — any CSS color. The default is a breath of near-black for dark UIs; pass a brand hue for a color wash.
tintStrengthnumber0.2Tint opacity (0–1) at the deepest point of the zone. 0 removes the tint layer entirely.
position"absolute" | "fixed""absolute""absolute" pins the haze inside the nearest positioned ancestor (give the container position: relative); "fixed" pins it to the viewport edge — the classic floating-toolbar / bottom-of-page treatment.
passThroughbooleantrueLet pointer events pass through to the content beneath the haze.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children">they pass through to the underlying element.

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