Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Typing Text

    Text that types, pauses, and deletes words from a list in turn, with a blinking cursor. Pauses when off screen.

    Build interfaces for Laravel, React, Vue

    Build interfaces for Laravel, React, Vue

    Build interfaces for Laravel, React, Vue

    Build interfaces for Laravel, React, Vue

    Build interfaces for Laravel, React, Vue

    <h2 class="text-2xl font-semibold tracking-tight text-ink">
        Build interfaces for
        <x-markas.typing-text :words="['Laravel', 'React', 'Vue']" class="text-muted" />
    </h2>
    import { TypingText } from "@/components/markas/TypingText";
    
    export default function TypingTextExample() {
      return (
        <h2 className="text-2xl font-semibold tracking-tight text-ink">
          Build interfaces for{" "}
          <TypingText words={["Laravel", "React", "Vue"]} className="text-muted" />
        </h2>
      );
    }
    <script setup lang="ts">
    import TypingText from "@/components/markas/TypingText.vue";
    </script>
    
    <template>
      <h2 class="text-2xl font-semibold tracking-tight text-ink">
        Build interfaces for
        <TypingText :words="['Laravel', 'React', 'Vue']" class="text-muted" />
      </h2>
    </template>
    <script lang="ts">
      import TypingText from "$lib/components/markas/TypingText.svelte";
    </script>
    
    <h2 class="text-2xl font-semibold tracking-tight text-ink">
      Build interfaces for <TypingText
        words={["Laravel", "React", "Vue"]}
        class="text-muted"
      />
    </h2>
    ---
    import TypingText from "@/components/markas/TypingText.astro";
    ---
    
    <h2 class="text-2xl font-semibold tracking-tight text-ink">
      Build interfaces for <TypingText
        words={["Laravel", "React", "Vue"]}
        class="text-muted"
      />
    </h2>
    import { Component } from "@angular/core";
    import { TypingText } from "./markas/typing-text.component";
    
    @Component({
      selector: "markas-example",
      imports: [TypingText],
      template: `
        <h2 class="text-2xl font-semibold tracking-tight text-ink">
          Build interfaces for
          <span markas-typing-text [words]="words" class="text-muted"></span>
        </h2>
      `,
    })
    export default class TypingTextExample {
      protected readonly words = ["Laravel", "React", "Vue"];
    }

    Examples

    Hero headline

    Your team ships
    faster, with confidence, every Friday

    One component library for Blade, React, and Vue, with the same classes everywhere.

    Your team ships
    faster, with confidence, every Friday

    One component library for Blade, React, and Vue, with the same classes everywhere.

    Your team ships
    faster, with confidence, every Friday

    One component library for Blade, React, and Vue, with the same classes everywhere.

    Your team ships
    faster, with confidence, every Friday

    One component library for Blade, React, and Vue, with the same classes everywhere.

    Your team ships
    faster, with confidence, every Friday

    One component library for Blade, React, and Vue, with the same classes everywhere.

    Terminal command

    $ pnpm dlx markasui add marquee

    $ pnpm dlx markasui add marquee

    $ pnpm dlx markasui add marquee

    $ pnpm dlx markasui add marquee

    $ pnpm dlx markasui add marquee

    Inline without cursor

    Your order is packed, on its way, out for delivery

    Your order is packed, on its way, out for delivery

    Your order is packed, on its way, out for delivery

    Your order is packed, on its way, out for delivery

    Your order is packed, on its way, out for delivery

    Installation

    npx markasui@latest add typing-text

    Usage

    <h1 class="text-4xl font-semibold">
        Build interfaces for
        <x-markas.typing-text :words="['Laravel', 'React', 'Vue']" />
    </h1>
    <x-markas.typing-text :words="['pnpm dlx markasui add marquee']" :loop="false" />
    import { TypingText } from "@/components/markas/TypingText";
    
    <h1 className="text-4xl font-semibold">
      Build interfaces for <TypingText words={["Laravel", "React", "Vue"]} />
    </h1>
    <TypingText words={["pnpm dlx markasui add marquee"]} loop={false} />
    <template>
      <h1 class="text-4xl font-semibold">
        Build interfaces for
        <TypingText :words="['Laravel', 'React', 'Vue']" />
      </h1>
      <TypingText :words="['pnpm dlx markasui add marquee']" :loop="false" />
    </template>
    <script lang="ts">
      import TypingText from "$lib/components/markas/TypingText.svelte";
    </script>
    
    <h1 class="text-4xl font-semibold">
      Build interfaces for <TypingText words={["Laravel", "React", "Vue"]} />
    </h1>
    <TypingText words={["pnpm dlx markasui add marquee"]} loop={false} />
    ---
    import TypingText from "@/components/markas/TypingText.astro";
    ---
    
    <h1 class="text-4xl font-semibold">
      Build interfaces for <TypingText words={["Laravel", "React", "Vue"]} />
    </h1>
    <TypingText words={["pnpm dlx markasui add marquee"]} loop={false} />
    import { Component } from "@angular/core";
    import { TypingText } from "./markas/typing-text.component";
    
    @Component({
      selector: "app-hero",
      imports: [TypingText],
      template: `
        <h1 class="text-4xl font-semibold">
          Build interfaces for
          <span markas-typing-text [words]="stacks"></span>
        </h1>
        <span markas-typing-text [words]="command" [loop]="false"></span>
      `,
    })
    export class Hero {
      protected readonly stacks = ["Laravel", "React", "Vue"];
      protected readonly command = ["pnpm dlx markasui add marquee"];
    }

    Angular uses an attribute selector on a span: <span markas-typing-text>.

    • The first word is rendered on the server. The animation starts by pausing on it, then deletes it and types the next one.
    • The loop pauses while the text is off screen. The Blade version needs Alpine.js.
    • Screen readers hear every word once, joined with commas, instead of each typed letter.
    • With reduced motion, the first word stays and the cursor does not blink.

    Props

    NameTypeDefaultDescription
    wordsstring[]-Words or phrases typed in turn. The first one is shown before the animation starts.
    typeSpeednumber70Milliseconds per typed character.
    deleteSpeednumber40Milliseconds per deleted character.
    pausenumber1800Milliseconds a full word stays before it is deleted.
    loopbooleantrueStart again after the last word. When false, the last word stays.
    cursorbooleantrueShow the blinking cursor after the text.

    Accessibility

    • Screen readers read all words once from a visually hidden copy, joined with commas; the typed text and cursor are aria-hidden.
    • The animation pauses when the text is off screen.
    • With reduced motion, the first word is shown in full and the cursor does not blink.

    Related components

    More animations components with the same classes in every framework.