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>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
$
<div class="overflow-hidden rounded-xl border border-line bg-surface">
<div class="flex items-center gap-1.5 border-b border-line px-4 py-3">
<span class="size-2.5 rounded-full bg-danger"></span>
<span class="size-2.5 rounded-full bg-warning"></span>
<span class="size-2.5 rounded-full bg-success"></span>
</div>
<p class="p-4 font-mono text-sm text-ink">
<span class="text-muted">$ </span><x-markas.typing-text :words="['pnpm dlx markasui add marquee']" :loop="false" :type-speed="50" />
</p>
</div>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
<p class="text-base text-muted">
Your order is
<x-markas.typing-text :words="['packed', 'on its way', 'out for delivery']" :cursor="false" class="font-medium text-ink" />
</p><script lang="ts">
import TypingText from "$lib/components/markas/TypingText.svelte";
</script>
<p class="text-base text-muted">
Your order is <TypingText
words={["packed", "on its way", "out for delivery"]}
cursor={false}
class="font-medium text-ink"
/>
</p>---
import TypingText from "@/components/markas/TypingText.astro";
---
<p class="text-base text-muted">
Your order is <TypingText
words={["packed", "on its way", "out for delivery"]}
cursor={false}
class="font-medium text-ink"
/>
</p>Installation
npx markasui@latest add typing-textpnpm dlx markasui@latest add typing-textyarn dlx markasui@latest add typing-textbunx --bun markasui@latest add typing-text- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Install the dependency:
npm install alpinejs - Copy the component source below to
resources/views/components/markas/typing-text.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/TypingText.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/TypingText.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/TypingText.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/TypingText.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/typing-text.component.ts.
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
| Name | Type | Default | Description |
|---|---|---|---|
words | string[] | - | Words or phrases typed in turn. The first one is shown before the animation starts. |
typeSpeed | number | 70 | Milliseconds per typed character. |
deleteSpeed | number | 40 | Milliseconds per deleted character. |
pause | number | 1800 | Milliseconds a full word stays before it is deleted. |
loop | boolean | true | Start again after the last word. When false, the last word stays. |
cursor | boolean | true | Show 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.
- Avatar GroupOverlapping stack of avatars that spreads out on hover, shows each name in a tooltip, and collapses extra people into a +N chip.
- Letter SwapText whose letters slide out and back in with a stagger when its link or button is hovered or focused. Forward, ping-pong, or shuffled order.
- MarqueeEndless horizontal or vertical scroll of any content, with faded edges, reverse direction, and a pause on hover or focus.
- Number TickerNumber that counts up to its value when it scrolls into view, with thousands separators, decimals, and a prefix or suffix.
- Scroll ProgressThin bar at the top of the page or a scrolling container that fills as the reader scrolls.
- Spotlight CardCard with a soft radial light that follows the pointer and a border that glows near it. Lights up on keyboard focus too.