Skip to content

Typewriter Caret

A copy-paste text effects component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Text EffectsHTMLCSSany framework
Hello, operator.

Copy into your project

HTML
<!-- Typewriter Caret — typing effect with blinking caret -->
<span class="nuda-tw-caret">Hello, operator.</span>
CSS
/* ── Typewriter Caret ────────────────────────────────────────
   Customize:
     --nuda-twc-steps   : number of characters in your text
     --nuda-twc-speed   : total typing duration
     --nuda-twc-caret   : caret color
   ──────────────────────────────────────────────────────────── */
.nuda-tw-caret {
  --nuda-twc-steps: 16;   /* update to match character count */
  --nuda-twc-speed: 3s;
  --nuda-twc-caret: #e4ff54;

  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fafafa;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--nuda-twc-caret);
  width: 0;
  animation:
    nuda-tw-caret-type var(--nuda-twc-speed) steps(var(--nuda-twc-steps)) forwards,
    nuda-tw-caret-blink 0.7s step-end infinite;
}

@keyframes nuda-tw-caret-type {
  to { width: 100%; }
}

@keyframes nuda-tw-caret-blink {
  50% { border-color: transparent; }
}

/* ── Accessibility ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nuda-tw-caret {
    animation: none;
    width: 100%;
    border-right-color: var(--nuda-twc-caret);
  }
}

How to use Typewriter Caret

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More text effects components

← Browse all NudaUI components