A single-layer backdrop-filter overlay with a CSS mask gradient — lightweight and GPU-friendly blur fade for any edge.
Made by LéoInstallation
Usage
How it works
Instead of stacking multiple backdrop-filter layers (which creates N compositing surfaces), this component uses a single backdropFilter: blur(Xpx) div masked with a CSS gradient. The mask goes from fully opaque at the edge to transparent at the interior, producing a smooth perceptual fade with minimal GPU overhead.
Tint is rendered via color-mix(in oklch, var(--background) N%, transparent) — one paint operation, no extra DOM node.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
side | "top" | "bottom" | "left" | "right" | "bottom" | The edge the blur is strongest at |
strength | number | 4 | Blur amount in pixels |
size | string | number | "160px" | Thickness of the blurred area |
tint | boolean | true | Adds a background-color fade alongside the blur |
tintStrength | number | 1 | Opacity of the tint at the solid edge (0–1) |
className | string | — | Extra class names on the wrapper |
The component also forwards all standard HTMLDivElement props.
Examples
Bottom only
Horizontal (left / right)
Without background tint
Set tint={false} to keep the pure blur effect without any colour overlay — useful over images or gradient backgrounds.