Scroll Blur Text
Words sharpen as they enter the center of the scrollport and blur again as they leave.
Scroll inside the box to sharpen words.
Customize
Installation
Add ScrollBlurText with the registry command:
npx shadcn@latest add @kinetic/scroll-blur-textUsage
Import ScrollBlurText and pass the text to split into words:
import { ScrollBlurText } from "@/components/kinetic/ui/scroll-blur-text";
export function EditorialLead() {
return (
<ScrollBlurText
text="Words come into focus as you scroll through the page."
className="text-2xl font-medium"
/>
);
}Blur, opacity, and shift
Tune maxBlurPx (clamped at 8 px), minOpacity, shiftPx, and speed to match your reading rhythm:
import { ScrollBlurText } from "@/components/kinetic/ui/scroll-blur-text";
interface ScrollQuoteProps {
readonly quote: string;
}
export function ScrollQuote({ quote }: ScrollQuoteProps) {
return (
<ScrollBlurText
text={quote}
maxBlurPx={6}
minOpacity={0.25}
shiftPx={6}
speed={1.25}
/>
);
}Manual control
Set trigger="manual" and use the ref handle to attach (play) or clear (reverse) the scroll effect on demand:
import { useRef } from "react";
import {
ScrollBlurText,
type ScrollBlurTextHandle,
} from "@/components/kinetic/ui/scroll-blur-text";
export function ControlledScrollText() {
const textRef = useRef<ScrollBlurTextHandle>(null);
return (
<div>
<ScrollBlurText
ref={textRef}
text="Attach or clear scroll focus at any time."
trigger="manual"
/>
<button type="button" onClick={() => textRef.current?.play()}>
Play
</button>
<button type="button" onClick={() => textRef.current?.reverse()}>
Reverse
</button>
</div>
);
}Motion preferences
When native ViewTimeline is available, ScrollBlurText drives blur, opacity, and vertical shift through the Web Animations API on the compositor thread without setting permanent will-change layers; because scroll timelines are continuous, onComplete only fires in reduced-motion or fallback modes. In browsers without ViewTimeline, it falls back to a multi-threshold IntersectionObserver driven by each word's intersectionRatio (words stay sharp across most of the viewport and soften near the edges rather than focusing strictly at the center) with zero layout reads on scroll. Under reduced motion, all words remain sharp at full opacity and no timeline or observer is attached.
API Reference
ScrollBlurText
Scroll-linked word focus component avoiding per-frame layout reads.
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | - | Paragraph text inside a scrollable container or page. |
maxBlurPx | number | 6 | Blur radius at scrollport edges (max 8px). |
minOpacity | number | 0.25 | Opacity at scrollport edges. |
shiftPx | number | 6 | Vertical offset in pixels when blurred. |