Skip to content
VenusUI
Get started

Typewriter

Types, pauses and deletes a list of words with a blinking caret.

Preview

Installation

npx shadcn@latest add @venusui/typewriter

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/typewriter.tsx

Usage

The code behind the preview above.

typewriter-demo.tsx

import { Typewriter } from "@/components/ui/typewriter"

export default function TypewriterDemo() {
  return (
    <p className="text-center text-3xl font-semibold tracking-tight">
      Build{" "}
      <Typewriter words={["landing pages", "dashboards", "design systems"]} className="text-muted-foreground" />
    </p>
  )
}

API reference

PropTypeDefaultDescription
wordsstring[]—Words or phrases to type in order. Required.
typeSpeednumber70Milliseconds per typed character.
deleteSpeednumber40Milliseconds per deleted character.
pausenumber1600Milliseconds to wait after a word is complete.
loopbooleantrueStart again after the last word. When false, the last word stays.
cursorbooleantrueShow the blinking caret.

All <span> props except children.

Requirements

  • Tailwind CSS v4. The CLI adds the typewriter-caret keyframes and --animate-typewriter-caret to your CSS.
  • React 19, with a cn helper at @/lib/utils.

Customization

  • Style the typed text with className, e.g. a muted or accent color, separate from the surrounding sentence.
  • The caret uses the text color and is 2px wide; edit its classes in the file to change it.

Accessibility

  • Screen readers hear all the words once, from a visually hidden list, instead of every keystroke.
  • With reduced motion, the first word is shown without typing.

Troubleshooting

Layout shifts while typing.
Give the container a minimum width or put the typewriter at the end of a line so changing width doesn’t move other text.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Blur Text

Text animations

Text whose words rise out of a blur one after another.

Loading preview

Gradient Text

Text animations

Text filled with a slowly moving gradient: a subtle sheen by default, or your own colors.

Loading preview

Number Ticker

Text animations

Counts up to a number when it scrolls into view, with locale-aware formatting.