Skip to content
kitn AI/UI

Text Shimmer

kai-text-shimmer

A gradient that sweeps across a word or short phrase — the quietest way to signal “working…” without a spinner stealing the scene.

  • Shadow DOM
  • Inline span
  • Tunable speed
  • Tunable spread
  • All scalar attributes
<kai-text-shimmer text="Thinking…" duration="3" spread="20"></kai-text-shimmer>

All props are scalar attributes — set them in HTML or via setAttribute. No JavaScript, no events.

  • duration — seconds per sweep (default 4; lower is faster).
  • spread — gradient width as a percentage (default 20; 5–45; wider looks softer).
  • as — swap the inner element from span to any block tag (e.g. "p") when layout demands it.

Lower duration to 2 and raise spread to 35 for a softer, quicker sweep — useful for longer phrases.

spread of 8 with default duration creates a crisp, focused highlight — stays subtle beside dense UI.

as="p" wraps the shimmer in a block element — handy when the label needs to sit on its own line above streaming output.

PropertyTypeDefaultNotes
text '' The text to shimmer.
as 'span' Element tag to render as (default `span`).
duration 4 Animation duration in seconds.
spread 20 Gradient spread (5–45).

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

TextShimmer