Skip to content
Textlab
1
Browse

ComponentsReveal

Slice reveal

The title arrives in offset horizontal slices.

Registered

Installation

$ npx shadcn@latest add @textlab/slice-reveal

Needs @textlab in your components.json. Setup takes a minute.

Usage

usage.tsx
import { SliceReveal } from "@/components/textlab/slice-reveal/slice-reveal";

<SliceReveal as="h2" variant="8" text="Registered" />

Variants

538

Props

PropTypeDefaultDescription
text*string–The copy.
variant"3" | "5" | "8""5"Number of horizontal slices.
offsetnumber0.35Starting distance of each slice as a share of the width.
asElementType"span"Rendered element.
trigger"mount" | "inView" | "hover" | "manual""inView"What starts the animation. manual follows `active`.
activebooleanfalseDrives trigger="manual".
oncebooleantrueIn view: play once instead of on every entry.
delaynumber0Seconds before the first part moves.
staggernumber0.05Seconds between parts.
durationnumber0.8Seconds each part takes.
easeEaseName | [number, number, number, number]"emphasized"Easing token or cubic bezier.
reducedMotion"user" | "always" | "never""user"user follows the OS setting; always shows the still version.
classNamestring–Merged onto the root.
onComplete() => void–Called when a one-shot animation finishes.

When to use it

Reach for it

  • Bold single-line display type, posters and title cards.
  • Brands with a print or editorial feel.

Skip it

  • Text that wraps onto several lines; slices are cut across the whole block.
  • Small sizes where slices are thinner than a stroke.

Accessibility and motion

Accessibility

  • The slices are aria-hidden copies; screen readers read the text once.
  • An invisible copy reserves the exact size, so nothing shifts.

Motion

  • Slices alternate direction and start 50 ms apart.
  • Opacity resolves early so the shape reads before the slices align.
Reduced motion. Shows the line whole and still.

Performance

  • N copies of the text, each with a static clip-path and a transform.