# Fold Reveal

> A headline folded like paper that opens out as it scrolls into view: each line swings down from its crease, concertina-style, with a shadow that lifts as it flattens.

Category: Text · Free · Updated 2026-11-10 · Live demo: https://www.motionkitui.com/components/fold-reveal

## When to use it

Editorial and portfolio headlines, launch pages, section titles and print-inspired brands.

## How it works

Each line sits in its own perspective box and starts rotated about 90 degrees on its X axis, hinged at the top or the bottom in turn, so the stack reads like a concertina. When it scrolls into view the lines swing flat one after another with a slightly overshooting ease, and a gradient shadow over each line fades as it opens, as light would on a real crease.

## Installation

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

Or copy `components/motionkit/fold-reveal.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 |
| --- | --- | --- | --- |
| `lines` | `string[] \| string` |  | The lines; pass an array or separate them with \n. |
| `duration` | `number` | `0.9` | Seconds for each line to unfold. |
| `stagger` | `number` | `0.12` | Seconds between lines. |
| `repeat` | `boolean` | `false` | Unfold every time it scrolls into view. |
| `as` | `ElementType` | `"h2"` | Element to render, e.g. h1. |

## Accessibility

- **Keyboard: Not applicable.** Text, not a control.
- **Screen readers: Pass.** Each line is real text, read in order; the crease shadows are hidden.
- **Reduced motion: Pass.** With reduced motion on, the lines fade in without folding.
- **Colour contrast: Pass.** It keeps your text colour; ivory on the site's dark measures 17:1 once the lines are open.

## Source

```tsx
"use client";

import type { ElementType } from "react";
import { motion, useReducedMotion } from "motion/react";

type FoldRevealProps = {
  /** The text; each line folds out on its own. Pass an array, or separate lines with \n. */
  lines: string[] | string;
  /** The element to render, e.g. "h1". */
  as?: ElementType;
  /** Seconds for each line to unfold. */
  duration?: number;
  /** Seconds between one line and the next. */
  stagger?: number;
  /** Unfold every time it scrolls into view, not just the first. */
  repeat?: boolean;
  className?: string;
};

/**
 * A headline folded like a sheet of paper that opens out as it scrolls into view: each line swings down from a
 * crease, alternating direction like a concertina, with a shadow in the fold that lifts as it flattens.
 */
export function FoldReveal({ lines, as: Tag = "h2", duration = 0.9, stagger = 0.12, repeat = false, className = "" }: FoldRevealProps) {
  const reduceMotion = useReducedMotion();
  const rows = Array.isArray(lines) ? lines : lines.split("\n");

  return (
    <Tag className={className}>
      <motion.span className="block" initial="folded" whileInView="open" viewport={{ once: !repeat, amount: 0.5 }} transition={{ staggerChildren: stagger }}>
        {rows.map((row, index) => {
          // alternate creases, top then bottom, as a concertina folds
          const fromTop = index % 2 === 0;
          return (
            <span key={index} className="block [perspective:900px]">
              <motion.span
                className="relative block"
                style={{ transformOrigin: fromTop ? "50% 0%" : "50% 100%", transformStyle: "preserve-3d" }}
                variants={{
                  folded: reduceMotion ? { opacity: 0 } : { opacity: 0, rotateX: fromTop ? -92 : 92, y: fromTop ? -6 : 6 },
                  open: { opacity: 1, rotateX: 0, y: 0 },
                }}
                transition={{ duration: reduceMotion ? 0.3 : duration, ease: [0.22, 1.2, 0.36, 1] }}
              >
                {row}
                {/* the shadow in the crease, lifting as the line flattens */}
                <motion.span
                  aria-hidden
                  className="pointer-events-none absolute inset-0"
                  style={{ background: `linear-gradient(${fromTop ? 180 : 0}deg, rgb(0 0 0 / 0.65), transparent 85%)` }}
                  variants={{ folded: { opacity: reduceMotion ? 0 : 1 }, open: { opacity: 0 } }}
                  transition={{ duration: reduceMotion ? 0 : duration * 0.9, ease: "easeOut" }}
                />
              </motion.span>
            </span>
          );
        })}
      </motion.span>
    </Tag>
  );
}
```
