Xzero UI
Pro library

AI sparkPro

A brand-quality animated spark mark. Four tapered rays and four lighter diagonals breathe at rest, ripple while thinking, pulse like a heartbeat while writing, then gather and settle when done. Every status change blends from the pose the mark is already in.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/ai-spark
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/ai-spark

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { AiSpark } from "@/components/xzero/ai-spark/ai-spark";

export function ReplyStatus({ phase }: { phase: "thinking" | "generating" | "done" }) {
  return <AiSpark variant="pill" status={phase} />;
}

Examples

Assistant avatar

<AiSpark variant="avatar" size={32} status={phase} announce={false} />

Inline in a sentence

<p>
  <AiSpark size="1em" tone="inherit" status="generating" announce={false} /> Drafting a reply to Maya Chen
</p>

Custom progress label

<AiSpark variant="pill" status="thinking" label="Searching 4 sources" />

Hero mark in an empty state

<AiSpark size={96} status="idle" />

API reference

AiSpark

An animated spark mark that shows an AI at work: four tapered primary rays and four lighter diagonal rays around a soft core. Each status is its own motion, and every change blends from the current pose, so states never hard cut. Use variant="pill" for a status label or variant="avatar" for a round tile.

PropTypeDefaultDescription
status"idle" | "thinking" | "generating" | "done" | "error"–What the AI is doing. Leave it unset and the spark plays through idle, thinking, generating and done on its own.
sizenumber | string24 (32 for the avatar, 16 in the pill)Size in px, or any CSS length such as "1em" to match surrounding text. The mark itself, the avatar tile, or the mark inside the pill. Proportions are hinted optically: small marks get heavier rays and under 18px the diagonals become dots.
tone"accent" | "foreground" | "muted" | "inherit""accent"Semantic color of the mark; the diagonals and core use a lighter tone of the same color. Error always eases to a muted danger tone.
colorstring–Any CSS color, overriding tone.
variant"mark" | "pill" | "avatar""mark"mark renders the spark alone. pill adds a crossfading status label (Ready, Thinking, Writing, Done, Couldn't finish) in a quiet bordered capsule. avatar sets the mark in a round, lightly tinted tile for message avatars and icon buttons.
labelstring–Pill text, overriding the built-in label for the current status, for example "Reading 12 files".
speednumber1Multiplies every loop and spin speed.
twinklebooleantrueA very slow breathing twinkle while idle. Turn it off for a fully still idle mark.
pausedbooleanfalseFreezes the animation in place; resuming continues from the same phase.
announcebooleantrueAnnounce status changes through a polite live region. Turn it off for decorative copies so only one spark speaks.
aria-labelstring–Accessible name. Defaults to a phrase for the status, such as "AI is thinking".
classNamestring–Class on the root span.
styleCSSProperties–Inline styles on the root span.

Keyboard interactions

KeysAction
NoneThe spark is a status indicator and takes no focus. Put controls such as Stop next to it.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in ai

Guidance for AI tools

AI spark: A brand-quality animated spark mark. Four tapered rays and four lighter diagonals breathe at rest, ripple while thinking, pulse like a heartbeat while writing, then gather and settle when done. Every status change blends from the pose the mark is already in. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components