Make your AI a shadcn expert

Backspace Text

Typewriter that types a phrase, deletes back to the longest common prefix with the next phrase, then types the next, with a blinking cursor for React, Next.js, and motion.

Backspace Text preview

Scroll to load preview

A typewriter that thinks out loud. Each phrase is typed one character at a time, held briefly, then partially deleted — but only as far back as the longest common prefix it shares with the next phrase. The next phrase types from there, so a sequence like "I write code." → "I write apps." → "I write systems." reads as a single train of thought correcting itself. The cursor blinks via Motion's infinite opacity loop, the type/hold/delete state machine runs in a single useEffect with proper teardown, and prefix detection is precomputed on phrase change with useMemo for stable timing. Configure type speed, delete speed, and the hold pause; pass any sizing through className. Ideal for hero rotating text where the "thought process" is part of the narrative.

Install with AI

If you've connected the shadcn.io MCP server to Claude Code, Cursor, Windsurf, or any MCP-ready AI editor, prompt your agent to install this text effect for you — no copy-paste, no CLI:

use shadcnio to install the backspace-text text effect into my project

FAQ

Was this page helpful?

Sign in to leave feedback.