Flip Text

Cycles through words with a letter-by-letter flip.

Coffee for slow mornings, long drives, late shifts, good company

import { FlipText } from '@brand-studio/ui';

export default function FlipTextDemo() {
  return (
    <h2 style={{ margin: 0, fontSize: 'clamp(28px, 5vw, 48px)', textAlign: 'center' }}>
      Coffee for <FlipText words={['slow mornings', 'long drives', 'late shifts', 'good company']} />
    </h2>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { FlipText } from '@brand-studio/ui';
Coffee for <FlipText words={['slow mornings', 'late shifts']} />

Accessibility

  • Screen readers hear every word once, as a list, instead of each change.
  • Under reduced motion the words swap without the flip.

API Reference

PropTypeDefault
wordsstring[]
interval?number2400
className?string''

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.