Components/TypingIndicator

TypingIndicator

An inline typing and loading indicator for chat.

VerifiedSince 1.0.0

Usage

Basic

Loading demo...

Variants

variant picks the style; each variant has its own size props.

Loading demo...

Best Practices

  • Use the default dots for inline chat rows and compact assistant placeholders.
  • Use ai for brand-led generation states with room for the larger loader.
  • Use pure, ring, circle-dash, or bars in toolbars, message metadata rows, or next to skeletons.
  • Keep showText=true unless a visible label nearby already names the pending operation.
  • Don't mix many variants in one transcript.

API Reference

Props

PropTypeDefaultDescription
variant'dots' | 'ai' | 'pure' | 'ring' | 'circle-dash' | 'bars''dots'Indicator style.
textstring'Typing…'Label shown while showText is on.
showTextbooleantrueShows the label.
ariaLabelstring-Screen-reader text while showText is off; falls back to text.
sizenumber6Dot diameter of dots, in px.
gapnumber5Gap between dots, in px.
loaderSizenumber44Size of ai, in px.
pureSizenumber14Diameter of pure, in px.
ringSizenumber18Diameter of ring, in px.
ringThicknessnumber2Stroke width of ring, in px.
circleDashSizenumber18Diameter of circle-dash, in px.
circleDashThicknessnumber2Stroke width of circle-dash, in px.
circleDashDashDegnumber12Dash angle of circle-dash, in degrees.
circleDashGapDegnumber12Gap angle of circle-dash, in degrees.
barsSizenumber12Height of bars, in px.

CSS Variables

VariableSourceDescription
--tx-typing-indicator-color--tx-text-color-secondaryColour of every variant, recolored in one place.

Overview

  • The root is role="status" with aria-live="polite"; every loader graphic is aria-hidden.
  • With showText off, a visually hidden label (ariaLabel, else text) still renders, so screen readers announce it.

Technologies

  • The ai variant draws through an SVG mask with a per-instance id, so several instances on a page don't collide.
  • Source: packages/tuffex/packages/components/src/chat/src/TxTypingIndicator.vue.
查看源码
packages/tuffex/packages/components/src/chat/index.ts