Typewriter

A typewriter component that cycles through text with a synced flashing highlight animation.

ReactHTML
React
Loading...

Installation

pnpm dlx shadcn@latest add https://atlasui.dev/r/typewriter.json

Usage

import { Typewriter } from "@/components/typewriter";
<Typewriter
  text={[
    "Building pixels with purpose",
    "Shipping faster than deadlines",
    "Deploy now, panic later!",
    "...",
  ]}
/>

Props

PropTypeDefaultDescription
textstring[]-Array of strings to display
letterDelaynumber0.025Delay between each letter (in seconds)
boxFadeDurationnumber0.125Duration of the box fade (in seconds)
textFadeOutDurationnumber0.25Duration of the text fade out (in seconds)
delayBetweennumber5500Delay between each text fade out (in ms)
classNamestring-Optional class names for custom styling.