# Kinetic Text

> Headlines that rise letter by letter, slide up line by line, blur into focus or light up as you scroll.

Category: Text · Free · Updated 2026-10-20 · Live demo: https://www.motionkitui.com/components/kinetic-text

## When to use it

Landing page headlines and editorial section titles, with four styles in one component: letters, lines, blur and a scroll-linked reveal.

## How it works

The text is split into letters, words or lines depending on the mode. Letters and blur use whileInView with a stagger. Lines slide up from behind an overflow clip. Scroll mode uses useScroll to map the text's position on screen to each letter's opacity, so the line lights up as you read down the page. Words never break across lines, and the real sentence is read once by assistive tech.

## Installation

```bash
npx shadcn@latest add https://www.motionkitui.com/r/kinetic-text.json
```

Or copy `components/motionkit/kinetic-text.tsx` below. Requires react, motion and Tailwind CSS v4. Free for personal projects; commercial use needs MotionKit Plus (https://www.motionkitui.com/pricing).

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` | `string` |  | The text. In lines mode, separate lines with \n. |
| `mode` | `"letters" \| "lines" \| "blur" \| "scroll"` | `"letters"` | How the text arrives. |
| `stagger` | `number` | `0.03` | Seconds between each letter, word or line. |
| `duration` | `number` | `0.6` | Seconds each piece takes to arrive. |
| `as` | `ElementType` | `"p"` | Element to render, e.g. "h1". |

## Accessibility

- **Keyboard: Not applicable.** Text only, with nothing to focus.
- **Screen readers: Pass.** The full sentence is read once. The split letters, words and lines are hidden from assistive tech.
- **Reduced motion: Pass.** With reduced motion on, the text renders plainly, with no split and no movement.
- **Colour contrast: Pass.** Contrast is set by your own text colour. In scroll mode, unread letters start at 15% opacity, so they are decorative until revealed.

## Source

```tsx
"use client";

import { useRef, type ElementType } from "react";
import { motion, useReducedMotion, useScroll, useTransform, type MotionValue } from "motion/react";

type KineticTextProps = {
  /** The text. In "lines" mode, separate lines with \n. */
  text: string;
  /**
   * letters: each letter rises in turn · lines: each line slides up from behind a mask ·
   * blur: words sharpen into focus · scroll: letters light up as you scroll past.
   */
  mode?: "letters" | "lines" | "blur" | "scroll";
  /** Seconds between each letter, word or line. */
  stagger?: number;
  /** Seconds each piece takes to arrive. */
  duration?: number;
  /** Element to render, e.g. "h1". */
  as?: ElementType;
  className?: string;
};

const ease = [0.22, 1, 0.36, 1] as const;

export function KineticText({
  text,
  mode = "letters",
  stagger = 0.03,
  duration = 0.6,
  as: Tag = "p",
  className = "",
}: KineticTextProps) {
  const reduceMotion = useReducedMotion();
  const flat = text.replace(/\n/g, " ");

  if (reduceMotion) return <Tag className={className}>{flat}</Tag>;

  return (
    <Tag className={className}>
      {/* screen readers read the sentence once, not letter by letter */}
      <span className="sr-only">{flat}</span>
      <span aria-hidden>
        {mode === "letters" && <Letters text={flat} stagger={stagger} duration={duration} />}
        {mode === "lines" && <Lines text={text} stagger={stagger} duration={duration} />}
        {mode === "blur" && <Blur text={flat} stagger={stagger} duration={duration} />}
        {mode === "scroll" && <ScrollReveal text={flat} />}
      </span>
    </Tag>
  );
}

type PartProps = { text: string; stagger: number; duration: number };

function Letters({ text, stagger, duration }: PartProps) {
  let count = 0;
  // words stay unbroken so lines only wrap between them
  return text.split(" ").map((word, w) => (
    <span key={w} className="inline-block whitespace-nowrap">
      {Array.from(word).map((char, c) => (
        <motion.span
          key={c}
          className="inline-block"
          initial={{ opacity: 0, y: "0.5em", rotate: 8 }}
          whileInView={{ opacity: 1, y: 0, rotate: 0 }}
          viewport={{ once: true }}
          transition={{ duration, delay: count++ * stagger, ease }}
        >
          {char}
        </motion.span>
      ))}
      {" "}
    </span>
  ));
}

function Lines({ text, stagger, duration }: PartProps) {
  return text.split("\n").map((line, index) => (
    // the clip hides each line until it slides up into place
    <span key={index} className="block overflow-hidden pb-[0.08em]">
      <motion.span
        className="block"
        initial={{ y: "110%" }}
        whileInView={{ y: 0 }}
        viewport={{ once: true }}
        transition={{ duration, delay: index * stagger * 4, ease }}
      >
        {line}
      </motion.span>
    </span>
  ));
}

function Blur({ text, stagger, duration }: PartProps) {
  return text.split(" ").map((word, index) => (
    <motion.span
      key={index}
      className="inline-block"
      initial={{ opacity: 0, filter: "blur(12px)", scale: 1.06 }}
      whileInView={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
      viewport={{ once: true }}
      transition={{ duration: duration * 1.4, delay: index * stagger * 3, ease }}
    >
      {word}
      {" "}
    </motion.span>
  ));
}

function ScrollReveal({ text }: { text: string }) {
  const ref = useRef<HTMLSpanElement>(null);
  // 0 as the text enters the lower part of the screen, 1 once it reaches the upper third
  const { scrollYProgress } = useScroll({ target: ref, offset: ["start 0.9", "start 0.35"] });
  const chars = Array.from(text);
  return (
    <span ref={ref}>
      {chars.map((char, index) => (
        <ScrollChar key={index} char={char} progress={scrollYProgress} range={[index / chars.length, (index + 1) / chars.length]} />
      ))}
    </span>
  );
}

function ScrollChar({ char, progress, range }: { char: string; progress: MotionValue<number>; range: [number, number] }) {
  const opacity = useTransform(progress, range, [0.15, 1]);
  return <motion.span style={{ opacity }}>{char}</motion.span>;
}
```
