Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Typewriter Hero Block for React

A compact centered hero whose headline types four words in turn behind a caret, with a Shine Button, a second action and a closing band with an avatar row and a pause button.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Say several things at once with a typewriter headline. "Turn tickets into" stays put while the word after it is typed in a ruled chip, held for two seconds, deleted and replaced: docs, answers, changelogs, fixes, then round again, behind a blinking caret. An announcement pill sits above the headline, and under it a sentence, a Shine Button and an outline button. A closing band, ruled across the page's side rails with + marks where it meets them, holds an avatar row with "Used by 1,900+ support teams" and a "Pause typing" button. It's built from Typing Text, Announcement, Status, Shine Button, Button, Avatar and Guides, with Lucide icons and Tailwind CSS. Made for SaaS landing pages, startup homepages and product sites with more than one value to put forward.

FAQ

How do I change the words that are typed?

Edit the WORDS array at the top of the file. Three to five short words work best: each one is typed, held for two seconds (pause) and deleted before the next, so a long list takes a while to come round. The chip keeps room for the longest word, whichever it is, so the headline never jumps as the words change length. The visually hidden sentence is built from the same array.

What do screen readers hear for the typing headline?

The whole sentence, once: "Turn tickets into docs, answers, changelogs, fixes". The typed letters and the caret are hidden from assistive technology, so a screen reader never reads a half-typed word or hears the headline change every few seconds. The headline is still the page's one h1.

What does the pause button do?

It stops the typing and leaves the chip on its first word, "docs", with no caret. Press it again and the typing starts over from the first word. It's a toggle button (aria-pressed) named "Pause typing", so a screen reader says whether it's on. Anything that moves on its own for more than five seconds needs a way to stop it (WCAG 2.2.2), and a headline that types forever is no exception. The button is a control, not a call to action: the Shine Button stays the page's one primary.

What happens with reduced motion?

With reduced motion each word appears whole, without being typed or deleted, and the caret stays still instead of blinking; the words still change in turn, and the pause button stops them. Without JavaScript, the chip shows its first word whole.

How do I make the typing faster or slower?

Change the props on TypingText: speed is the average time per letter (110 ms here), deleteSpeed the time to delete one (60 ms), and pause how long a typed word stays (2000 ms). Each keystroke's wait varies a little around speed (jitter), so it reads like a person typing; set jitter={0} for an even beat.

When should I use a typewriter hero instead of a static headline?

Use it when your product has several short benefits that finish the same sentence, and you want the first screen to say all of them. Use a static headline when one message carries the page: it's quicker to read, and nothing competes with your calls to action.

  • Pro

    Typing Animation Hero

    Type and motion

    A compact hero whose descriptive sentence types itself out once, behind a caret, in a framed box under a static headline, with a Shine Button, a second action and a ruled list of plan facts.

  • Pro

    A start-aligned statement hero whose headline ends on two words that fade from the text color toward the page, with a Shine Button, an outline button and a ruled band of three proof cells.

  • Pro

    A compact centered hero whose second headline line glints as a light runs through it, with a launch pill, the Shine Button and four stats in cells below.

  • Pro

    Centered Minimal Hero

    Type and motion

    A compact centered type-only hero: a two-line headline with a muted second line, one sentence, a Shine Button and a second action, on faded rails.

  • Pro

    A compact, centred hero for a design tool on solid rails: concentric rings breathe behind a headline, a Shine Button and an outline button, over a ruled band of three stats.

  • Pro

    Animated Counter Hero

    Stats and live data

    A compact centered hero for an invoicing app with an announcement pill, a Shine Button and a second action, over a hairline band of four figures that count up when they scroll into view.