GradualBlur
Layered backdrop blur overlay for soft edge fades, presets, hover intensity, and responsive dimensions.
GradualBlur
TxGradualBlur stacks masked backdrop-filter layers to create a directional edge fade. Presets provide common edge strengths, while explicit props override preset values for precise parent or page overlays.
Basic Usage
GradualBlur
Demo will load when visible.
Direction (Top / Bottom / Left / Right)
Positions
Demo will load when visible.
Preset
Presets
Demo will load when visible.
Hover Intensity Boost (hoverIntensity)
HoverIntensity
Demo will load when visible.
Trigger on Viewport (animated="scroll")
Animated scroll
Demo will load when visible.
Page Target (target="page")
Target page
Demo will load when visible.
Responsive Sizes (responsive)
Responsive sizes
Demo will load when visible.
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
position | 'top' | 'bottom' | 'left' | 'right' | 'bottom' | Edge where the blur overlay is anchored and the mask gradient direction is derived. |
strength | number | 2 | Multiplier used to calculate each layer's blur radius. |
height | string | '6rem' | Overlay thickness for top/bottom positions; also used as fallback width for left/right positions. |
width | string | - | Overlay width. Top/bottom default to 100%; left/right fall back to height when omitted. |
divCount | number | 5 | Number of masked blur layers; values below 1 are clamped to one layer. |
exponential | boolean | false | Uses exponential blur scaling instead of linear per-layer blur scaling. |
curve | 'linear' | 'bezier' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | Curve used to distribute blur progression across layers. |
opacity | number | 1 | Opacity applied to every blur layer. |
animated | boolean | 'scroll' | false | Enables opacity/filter transitions; 'scroll' waits for intersection visibility before fading in. |
duration | string | '0.3s' | CSS duration used by opacity and blur transitions. |
easing | string | 'ease-out' | CSS easing used by opacity and blur transitions. |
zIndex | number | 1000 | Base z-index. Page-target overlays add 100 to this value. |
target | 'parent' | 'page' | 'parent' | parent renders absolute positioning; page renders fixed positioning. |
hoverIntensity | number | - | Multiplies blur strength while hovered and enables pointer events on the overlay. |
responsive | boolean | false | Enables viewport-width based height/width overrides and installs a debounced resize listener. |
mobileHeight | string | - | Height used at viewport widths <= 480px when responsive is enabled. |
tabletHeight | string | - | Height used at viewport widths <= 768px when responsive is enabled. |
desktopHeight | string | - | Height used at viewport widths <= 1024px when responsive is enabled. |
mobileWidth | string | - | Width used at viewport widths <= 480px when responsive is enabled. |
tabletWidth | string | - | Width used at viewport widths <= 768px when responsive is enabled. |
desktopWidth | string | - | Width used at viewport widths <= 1024px when responsive is enabled. |
preset | 'top' | 'bottom' | 'left' | 'right' | 'subtle' | 'intense' | 'smooth' | 'sharp' | 'header' | 'footer' | 'sidebar' | 'page-header' | 'page-footer' | - | Applies a preset config first; explicitly provided props still override preset values. |
gpuOptimized | boolean | false | Adds will-change: backdrop-filter, opacity and translateZ(0) to the overlay. |
onAnimationComplete | () => void | - | Called after a scroll-triggered overlay becomes visible and the configured duration elapses. |
className | string | '' | Extra class appended to the root element. |
style | CSSProperties | {} | Extra inline style merged into the root style after generated positioning styles. |
Usage Tips
- Container positioning When
target="parent", set parentposition: relativeand useoverflow: hiddento clip edges. - Browser support Depends on
backdrop-filter; rendering may vary across engines.