Ink Reveal Text
Organic SVG turbulence and displacement ink-bleed text reveal triggered in the viewport, clearing its filter on settle for crisp typography.
Ink settles across the page into sharp type
Customize
Installation
npx shadcn@latest add @kinetic/ink-reveal-textUsage
Pass a string to text. By default, InkRevealText uses trigger="inView" and unit="word": when the element enters the viewport, each word enters via staggerReveal while a scoped SVG feTurbulence and feDisplacementMap filter decays smoothly from spread down to 0.
Once the reveal settles, InkRevealText removes the CSS filter property completely so the resting text renders at native subpixel sharpness with zero ongoing filter overhead.
import { InkRevealText } from "@/components/kinetic/ui/ink-reveal-text";
interface EditorialQuoteProps {
readonly quote: string;
}
export function EditorialQuote({ quote }: EditorialQuoteProps) {
return (
<InkRevealText
as="p"
text={quote}
className="max-w-xl text-2xl font-medium leading-relaxed"
/>
);
}Turbulence and pacing
Shape the ink grain with spread (default 26, clamped 0 to 60), frequency (default 0.045, clamped 0.01 to 0.15), and seed (default 7, clamped 0 to 999). Adjust reveal cadence using unit ("word", "char", or "line"), staggerMs (default 45, clamped 0 to 300), durationMs (default 760, clamped 120 to 4000), and shiftY (default 6, clamped -40 to 40).
import { InkRevealText } from "@/components/kinetic/ui/ink-reveal-text";
import type { SplitTextUnit } from "@/components/kinetic/ui/lib/split-text";
interface ChapterHeadingProps {
readonly title: string;
readonly unit: SplitTextUnit;
}
export function ChapterHeading({ title, unit }: ChapterHeadingProps) {
return (
<InkRevealText
as="h2"
text={title}
unit={unit}
spread={34}
frequency={0.055}
staggerMs={35}
durationMs={820}
className="text-3xl font-semibold tracking-tight"
/>
);
}Imperative control
Set trigger="manual" (or keep "inView" / "mount") and attach an InkRevealTextHandle ref to replay with play() or hide units back to their initial state with reset().
import { useRef } from "react";
import { InkRevealText, type InkRevealTextHandle } from "@/components/kinetic/ui/ink-reveal-text";
interface ReplayableInkProps {
readonly text: string;
}
export function ReplayableInk({ text }: ReplayableInkProps) {
const ref = useRef<InkRevealTextHandle>(null);
return (
<div className="space-y-3">
<InkRevealText ref={ref} text={text} trigger="manual" className="text-xl font-medium" />
<div className="flex gap-2">
<button type="button" onClick={() => ref.current?.play()}>
Play
</button>
<button type="button" onClick={() => ref.current?.reset()}>
Reset
</button>
</div>
</div>
);
}Accessibility and reduced motion
The scoped inline <svg> filter element is zero-sized and marked aria-hidden="true" and focusable="false". Text units render through SplitText, giving screen readers one clean sr-only string (overridable via aria-label) while keeping animated spans aria-hidden="true".
durationMs, staggerMs, and speed scale with the global Kinetic tempo. When reduced motion is active via browser settings or data-reduced-motion="true", InkRevealText skips the SVG displacement filter and stagger transition, displays crisp text immediately, and calls onComplete.
API Reference
InkRevealText
Viewport-triggered SVG turbulence displacement reveal paired with staggerReveal, detaching its filter once settled.
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | - | Text to reveal. |
unit | "char" | "word" | "line" | "word" | Split granularity passed to SplitText. |
trigger | "inView" | "mount" | "manual" | "inView" | When the ink reveal plays automatically. |
spread | number | 26 | Initial feDisplacementMap scale (clamped 0 to 60). |
frequency | number | 0.045 | Turbulence baseFrequency controlling ink grain (0.01 to 0.15). |
durationMs | number | 760 | Base settle duration in milliseconds. |
staggerMs | number | 45 | Delay between consecutive text units. |
speed | number | 1 | Speed multiplier combined with global tempo. |