AI Elements

Loader

The spinning radial loader the chat shows while the model thinks. Sized in pixels.

packages/design-system/components/ai-elements/loader.tsx

Examples

Loader
Default, 16px
Loader
24px
Loader
Thinking
With a label, as the builder shows it

Anatomy

  1. 01Wrapper, animate-spin
  2. 02Eight strokes in currentColor, fading round

Usage

import { Loader } from "@repo/design-system/components/ai-elements/loader";

{status === "submitted" ? <Loader /> : null}

Props

PropTypeDefaultDescription
sizenumber16Width and height, in pixels.
classNamestringnoneMerged last with cn(). Use it for layout (width, margin), not to restyle the component.

Guidance

Do

  • Show it between sending and the first streamed token.

Don't

  • Keep it once text is streaming; the text is the progress.

Where it's used