AI Glow Border
Light the edge of a prompt bar while an assistant thinks and streams, and fade it out when the reply is done.
Overview
AI Glow Border draws light along the edge of a rounded element to show what an assistant is doing. It has one prop that matters most, state, and each state looks different:
Moving between states cross-fades, so a reply that goes from thinking to streaming to idle reads as one continuous motion. The light is drawn on a canvas that sits over the element and reaches past its edges by the bloom distance. That canvas ignores pointer events and is positioned absolutely, so the wrapped element keeps its own layout, focus ring, and click targets.
It is made for Prompt Bar, and the Prompt Bar docs show it driven by a reply. Use Pulsing Border instead when you need one ambient glow without states.
Installation
Usage
import { AiGlowBorder } from "honestui/shaders"
import { PromptBar } from "@/components/ai/prompt-bar"
<AiGlowBorder state={status} intensity={tokenRate}>
<PromptBar onSubmit={send} onStop={isBusy ? stop : undefined} />
</AiGlowBorder>Map your chat status onto state: thinking from the moment a prompt is sent until the first token, streaming while tokens arrive, and idle when the reply finishes. Set state="error" when a request fails or is stopped; the flash plays once, and you can return to idle whenever you like.
radius defaults to "auto", which reads the border radius of the first rounded element that fills the child. That covers Prompt Bar, whose form wraps a rounded field. Pass a number when the child is not rounded in CSS, for example when it is clipped by a parent.
To make streaming feel connected to the reply, pass a token rate scaled to 0–1 as intensity. Ancestors with overflow: hidden clip the bloom, so leave room around the element or reduce bloom.
Accessibility
The light is decorative and hidden from assistive technology. It shows the same status your interface already has, so announce that status in text as well, for example in a live region or in the name of the Stop button. Never rely on the light alone, and never show it for work that is not happening.
When the user prefers reduced motion, each state is drawn as one still frame: an even ring for thinking and streaming, and a brief red ring for an error. Browsers without WebGL2 get a still CSS ring that fades between states. The light sits outside the element and inside it only by a few pixels, so it does not reduce the contrast of the element's text, border, or focus ring.