Components

React component for shadcn/ui

Kinetic Heading

A React text reveal heading for shadcn/ui that rises word by word or letter by letter from a masked baseline on mount or scroll, with springs, grapheme-safe splitting, and zero layout shift.

Loading…

Kinetic Heading is a free and source-available React text reveal for shadcn/ui. It splits a heading into words or letters and lifts each one out of a masked baseline on its own spring, so hero copy lands one beat at a time. Install it with npx shadcn@latest add @tentui/kinetic-heading for landing page hero titles, section headings, and scroll-driven storytelling.

Example

Loading…

Features

  • Masked baseline reveal. Each word sits in a clipping mask padded for descenders and accents, and its text rises from translateY(100%) on a spring (stiffness 260, damping 26) while its opacity eases in.
  • Word or letter split. split="word" staggers 40 ms per word by default and split="letter" staggers 18 ms per letter. Letters stay grouped inside their word, so text never wraps mid-word.
  • Grapheme-safe splitting. Letters are split with Intl.Segmenter, so emoji, flags, and combining accents are never broken apart.
  • Mount or view triggers. trigger="view" plays once when the heading clears the bottom 10% of the viewport.
  • Interruptible replay. replay() snaps every unit back below its mask and restarts, even mid-reveal, with no flash of the settled text.
  • Zero layout shift. The split markup renders on the server and the hidden state uses only transform and opacity, so the heading reserves its final size from the first paint.

Installation

pnpm dlx shadcn@latest add @tentui/kinetic-heading

Usage

import { KineticHeading } from "@/components/kinetic-heading";
<KineticHeading as="h1" className="text-5xl font-semibold tracking-tight">
  Build interfaces that feel alive
</KineticHeading>

children must be a plain string. Kinetic Heading inherits its font, size, and color from className, and renders an h2 unless you pass as (h1 through h6). Use \n in the string to force a line break.

Split and stagger

Pass split="letter" to reveal letter by letter, and stagger to set the gap between units in milliseconds. delay holds the first unit back.

<KineticHeading as="h2" split="letter" stagger={24} delay={150}>
  {"Quiet by default,\nloud when it counts"}
</KineticHeading>

Scroll trigger

trigger="view" waits until the heading scrolls into view, then plays once.

<KineticHeading trigger="view" className="text-3xl font-semibold">
  Motion with intent
</KineticHeading>

Replay and completion

Attach a ref to call replay(), or change the heading's key. Changing children or split also replays it. onComplete fires once every unit has settled, and haptic adds a single light tick at that moment on supported devices.

const ref = useRef<KineticHeadingHandle>(null);
 
<KineticHeading ref={ref} haptic onComplete={() => setReady(true)}>
  Shipping today
</KineticHeading>
<button onClick={() => ref.current?.replay()}>Replay</button>

Accessibility

Kinetic Heading renders one native heading element named with aria-label, so its text is announced once, and the split words and letters are aria-hidden, so screen readers never read the heading word by word. The text appears in the DOM only once, so copying, find-in-page, and search engines see the original string. The heading has no focusable parts, so it needs no focus management.

Under prefers-reduced-motion: reduce, units render at full opacity from the first paint with no transform or stagger, and onComplete still fires.

API reference

PropType
PropType

FAQ

How do I install Kinetic Heading with shadcn?

Run npx shadcn@latest add @tentui/kinetic-heading after adding the @tentui registry to components.json (installation guide). The CLI copies kinetic-heading.tsx into your project and installs motion and web-haptics.

Is Kinetic Heading accessible to screen readers?

Yes. It renders a single native h1 to h6 element whose text is announced once through its aria-label, while the animated word and letter spans are aria-hidden. With prefers-reduced-motion: reduce, the text appears immediately with no movement.

Can I replay the reveal or trigger it on scroll?

Yes. Use trigger="view" to play once when the heading scrolls into view, call replay() on a ref, or change its key. A replay that starts mid-reveal drops every unit back below its mask and starts again without flicker.

Does Kinetic Heading cause layout shift?

No. The split markup is rendered on the server and the hidden state only uses transform and opacity, so the heading takes its final size and line breaks from the first paint.

How is Kinetic Heading different from Text Scramble?

Text Scramble cycles each letter through random glyphs before settling on the final word. Kinetic Heading never changes the characters: it reveals the real words or letters in order as they rise from a masked baseline.

Is Kinetic Heading free to use?

Yes. Kinetic Heading is free and source-available: the shadcn CLI copies its source into your project, and you can use it in unlimited personal and client projects under the TentUI License.

All text and visual effects
All guides