VisorVisor
ComponentsTypography

AnimatedTitle

A title drawn word by word in CSS. Each word rises, unblurs or settles its weight in turn, and screen readers read the whole title once.

Each word is its own span with a CSS animation; word i starts at delay + i × stagger. There is no animation library and no timer, so server and client markup match. The title plays once when it mounts: press Replay to watch it again.

Blur

The default. Each word lifts 6px into focus from a 14px blur as it fades in: 1.1s per word, 60ms apart.

Tell us about your weekend

Rise

Each word slides up out of its own mask: 1.05s per word, 55ms apart.

Friday night at the lake

Weight

Each word fades in from weight 300 and settles at 520: 1.3s per word, 50ms apart. The settled weight is a plain rule, so the title looks the same with or without motion.

Edit your arrival

Hold and Start Delay

play={false} holds every word on its first frame, hidden, until you set it to true. delay (ms) waits before the first word starts. Replay by changing the title's key.

Saturday afternoon

Format

format draws each word. Here hyphens become en dashes, as Backstage's edit sheet draws its times.

Fri 6-9pm check-in

In Five Looks

The three entrances in each look, on the theme picked in the docs. The ink is the theme's text colour; the motion is the same in every look. Reload the page to replay.

Today
Dark
Dark + Photo
Light
Light + Photo

Honcho Backstage

Today is the honcho theme; the other four looks are honcho-backstage.

Today
Dark
Dark + Photo
Light
Light + Photo

Installation

npx visor add animated-title

This copies two files into your project:

  • components/ui/animated-title/animated-title.tsx — the component
  • components/ui/animated-title/animated-title.module.css — the keyframes and settings

Usage

import { AnimatedTitle } from '@/components/ui/animated-title/animated-title';

export default function Intro() {
  return <AnimatedTitle as="h1" text="Tell us about your weekend" />;
}

Settings

Set these on the title or any ancestor. The defaults are the Honcho kit's numbers, deliberately not motion-scale steps, so the title moves the same in every theme. The curve is the theme's --motion-easing-enter.

VariableDefaultWhat it sets
--animated-title-duration1.05s rise, 1.1s blur, 1.3s weightEach word's run
--animated-title-stagger55ms rise, 60ms blur, 50ms weightThe gap between one word's start and the next
--animated-title-delay0msBefore the first word starts (the delay prop)

Exit

CSS can't animate an element as it unmounts. To animate the title out, wrap it in your app's own motion item.

API Reference

AnimatedTitleProps

PropTypeDefaultDescription
textstring—The title. Split into words on single spaces.
as'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span''h2'The element to render.
animation'rise' | 'blur' | 'weight''blur'How each word arrives: up out of a mask, up into focus, or from light to settled weight.
format(word: string) => ReactNode—Draws each word, for example swapping hyphens for dashes.
playbooleantruefalse holds every word on its first frame. Replay by changing the component's key.
delaynumber0Milliseconds before the first word starts. Sets --animated-title-delay.

The component also accepts all standard HTML attributes, and forwards its ref to the element.

Accessibility

  • The element holds the full title once, in a visually hidden copy; the animated words sit in an aria-hidden wrapper, so a screen reader reads the title once
  • Under prefers-reduced-motion: reduce the words have no animation and show settled
  • Each word has 0.2em of room above and below, so accents and descenders are never clipped while it animates
  • AnimatedTitle sets no colour: the title takes the surrounding text colour