NK

Search

Search pages, posts, and components

All components

Word Reveal

Animation

Reveals a sentence one word at a time as it enters.

Builttobecopied,pasted,andowned.

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/word-reveal.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge
  2. 2. Copy the component source into components/library/word-reveal.tsx

Props

PropTypeDefaultDescription
textstring - Sentence to reveal.
staggernumber0.06Seconds between each word.
classNamestring - Classes applied to the wrapper.

Accessibility

  • Renders real text, so screen readers announce the sentence normally.
  • Honours prefers-reduced-motion by skipping the entrance offset.

Dependencies

motionclsxtailwind-merge