Glitch Text

Text that tears into offset accent slices every few seconds, like a lost signal.

404

Lost signal. This page is not here.

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

export default function GlitchTextDemo() {
  return (
    <div style={{ display: 'grid', justifyItems: 'center', gap: 12, textAlign: 'center' }}>
      <div style={{ font: '800 clamp(5rem, 22vw, 9rem)/1 ui-monospace, SFMono-Regular, Menlo, monospace', letterSpacing: '-.04em' }}>
        <GlitchText text="404" />
      </div>
      <p style={{ margin: 0, color: 'var(--bs-muted)' }}>Lost signal. This page is not here.</p>
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { GlitchText } from '@brand-studio/ui';
<NotFound art={<GlitchText text="404" />} />

It takes the font and size of its parent, so set those on the element around it. Keep it to a number or a word or two.

Accessibility

  • Screen readers hear the text once; the two torn copies are hidden from them.
  • The tear lasts a fraction of a second every three seconds and never flashes the whole text.
  • Under reduced motion the slices hold still as one fixed tear.

API Reference

PropTypeDefault
textstring–
as?React.ElementType–
className?string''

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