cnippet/ui
  1. motion
  2. text animations
  3. colorful text

text animations

Colorful Text

Each character animates in from below with a randomly assigned vibrant colour. Fully customisable colour palette, stagger speed, and spring transition.

Installation

Usage

Anatomy

Good to know

  • children must be a plain string. It's split into letters, each given a color from colors.
  • It plays as soon as it mounts, even off screen. To start it when it scrolls into view, pass trigger={isInView} using useInView from motion/react.
  • Screen readers read the full text once; the individual letters are hidden from them.
  • When the user has turned on reduced motion, the text shows in its final state straight away, with no stagger or movement.

Props

Examples

Hero Headline

Full sentence reveals character-by-character with random colours from the default vibrant palette.

Brand Logotype

Short all-caps word with a custom 5-colour brand palette (violet → teal) and a bolder spring for snappier entrance.

Cycling Phrases

A "Next phrase" button resets trigger and re-mounts with a new key, replaying the colour animation on demand across multiple phrases.