Typewriter Hero
A bold centered headline that types a rotating keyword, over a dot pattern.
Installation
npx shadcn@latest add @venusui/hero-03Run 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.tsxfrom typewriter@/components/ui/dot-pattern.tsxfrom dot-pattern@/components/hero-03.tsx
Also adds the shadcn button component if your project doesn't have it yet.
Usage
The code behind the preview above.
hero-03-demo.tsx
import { Hero03 } from "@/components/hero-03"
export default function Hero03Demo() {
return <Hero03 />
}
API reference
No props. Edit the headline, the words list and the actions in the file.
Requirements
- shadcn
buttonand VenusUItypewriteranddot-pattern. The CLI installs them, including the typewriter’s CSS. lucide-react, React 19 and Tailwind CSS v4.
Customization
- Keep the rotating words short and similar in length, so the headline doesn’t jump between lines.
- Change the dot color with the
classNameonDotPattern, e.g.text-primary/20.
Accessibility
- Screen readers hear the headline with all rotating words once, not every keystroke.
- With reduced motion the first word is shown without typing.
Troubleshooting
- The caret doesn’t blink.
- Check that the
typewriter-caretkeyframes were added to your CSS (the CLI does this). 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 initin your project first.