Skip to content
TrademarkTrademark
Docs
Modules

AI

Updated: October 20, 2026
View on GitHub

Use these where an assistant is doing something the person is waiting on. Every piece takes the brand color, so inside a themed chat it follows the chat's theme, and every piece keeps saying "working" under reduced motion without moving.

WorkingIndicator

A moving mark and a verb that changes every few seconds, like "Imagining…" or "Noodling…". The first render always shows the first verb, so server and client agree; the order shuffles after mount.

Your own words

Pass verbs to give a product its own voice, or spread workingVerbs to add to the default list. label shows one fixed line instead, for a step you can name.

Elapsed time and a hint

showElapsed counts seconds since startedAt (or since the indicator appeared), and detail adds a quiet hint after it.

Sizes

VoiceVisualizer

The animation for a voice conversation. Each state moves differently: idle breathes, listening ripples, thinking swirls and speaking pulses like syllables. Give it the microphone stream while listening and the reply's <audio> element while speaking, and it follows the real sound. Use orb for a full-screen voice mode and bars for a composer or a call bar.

Levels are written straight to CSS variables every frame, so a live microphone never re-renders React. When your voice SDK already gives you a loudness number, pass it as level instead. To drive something of your own, useAudioLevel(source) returns the same loudness from 0 to 1.

Mascot

A companion for an assistant: one soft, single-color shape with a pair of eyes. It idles, listens, thinks, speaks and sleeps, with a mood on top (happy, surprised, sad, skeptical, wink, focused, determined). By default the eyes are tiles of the Once UI mark, and while it thinks they turn like the LogoSpinner. When it looks around, the eyes slide over the body and the one nearer the edge narrows, as if the body were round; while speaking, the body pulses with the reply's audio.

Make it yours

Every part of the look is a prop, so two products never have to share a character. color takes a scheme or any CSS color and every shade comes from it; roundness, aspect or your own bodyPath set the outline; surface is glossy, matte, flat or glass. eyes is tile, pill, round, wide, dot or your own path, placed with eyeSize, eyeSpacing and eyeHeight. mouth, brows and cheeks add features that follow the mood, accessory dresses it (below), and personality makes it calm or bouncy. Or pass a seed (a product name, a user id) and mascotLook(seed) picks a whole look; props you pass still win.

Seeds that read words

A seed is split into words at dashes, underscores, spaces, digits and camelCase, and the words it knows describe the mascot: colours set the hue (red, mint, ink or a hex like #3fe3f2), animals set the body and, where they have them, the ears (fox, panda, frog, robot), moods set the eyes, mouth and how it moves (happy, sleepy, grumpy), and objects add accessories (royal a crown, dj headphones, astro a helmet). An animal brings its own colour unless the seed names one. Anything the words leave open comes from the seed's hash, so a username with no known words still gets a stable mascot of its own. readSeedWords(seed) says which words it understood, and MASCOT_SEED_WORDS lists them all.

Canonical mascots

Some names stand for a real identity and draw a hand-made character instead of a generated one: once-ui is the Once UI mark come alive, quasar is Quasar, and every Dopler product (stack, aveiro, chirio, tavilio, sigilio and the rest) has its own. claude draws Claude, the assistant the apps work with: a flat terracotta block with tall square eyes, little arms and four short legs. Use it wherever an app marks what Claude wrote or did, such as a reply "via Claude" or an assistant card. Spelling, case and dashes don't matter ("Once UI", "onceui"), but the whole seed has to be the name, so once-ui-fan is generated as usual. Props you pass still win, so the owner of an identity can recolour or dress it.

Core can't know who typed a seed. Where people choose the text (a username, an agent's name), show the canonical mascot only to its owner and pass canonical={false} to everyone else; reserve MASCOT_IDENTITY_KEYS in sign-ups so nobody else can hold the name.

Accessories

Nine built-in accessories (and the trade wardrobe below), flat and chunky so they read at avatar size: antenna, bow, beanie, headphones, sprout, helmet, crown, catEars and partyHat. Each one is placed from the body's own outline, a drawn bodyPath included, so it fits a block, an egg or a circle (ears grow out of the head instead of floating over it), and moves and squashes with it. Pass a list to wear several, and accessoryColor to tint them all one color. Your own SVG still works: draw it in the body's 200 × 200 box.

Trade wardrobe

Dress the mascot for a line of work. Hats: cap, hardHat, chefHat, beret, topHat, gradCap, headband. Worn: glasses (on the face, so they follow the gaze), scarf, bowTie, apron, badge. Held, one in each hand: box, wrench, cup, pottedPlant, laptop, paintbrush, book, camera, shoppingBag, dumbbell, scissors, key. accessoryColor also takes one color per piece, and accessoryMark sets up to three letters on the pieces with room for them (a cap, a box, an apron, a badge, a bag, a book, a cup, a laptop lid), so a mover's mascot can carry its own boxes. Seed words reach them too: mover brings the cap and a box, barista an apron and a cup.

accessory moves with the body and leans a little toward where the mascot looks, like a head tilting. Something that belongs to the face, such as a beak, a nose, glasses or whiskers, goes in faceAccessory instead: it rides on the face layer, so it turns with the gaze, glances up while thinking, drops when it sleeps or is sad, and jumps with a poke, as the eyes and cheeks do. Draw it in the same 200 × 200 box; with the default look the eyes sit at 71,96 and 129,96.

Layers that move

layers draws shapes as path data in the same 200 × 200 box, so a whole outfit can be saved as JSON in a MascotDesign and shown the same in every app. Each layer sits back (behind the body), on it or front of the face, and can carry a small loop with motion: float, bob, sway, spin, pulse or flicker. spin, sway and pulse turn around origin, written as "x y". Built-in accessories and layers can be worn together: a crown from the list over a hand-drawn jetpack. Loops stop for people who ask for reduced motion, and mascotSvg draws layers as a still. Layers that give the same motion and origin keep one phase, so a thing drawn in several layers, such as a ghost and its eyes or a flame and its core, moves as one. A MascotDesign holds up to 48 layers: enough for a hat, glasses, something held, a back piece and a pet.

Mediums

medium draws the same character another way. fur grows a soft coat in clumped tufts, plush gives the body felt, clay models it in plasticine, pixel turns the whole mascot into a sprite with a one-pixel outline, lowpoly cuts the body into lit facets and toon inks it with cel shading. vector, the flat mascot, stays the default. Each medium is an SVG filter or plain shapes, so it animates live with no WebGL, renders on the server through mascotSvg({ medium }), and holds still under reduced motion like the vector mascot. MASCOT_MEDIUMS lists them for a picker, and parseMascotDesign keeps a known medium in a saved design and drops anything else.

Cube

working="cube" gives the mascot something to do while it works. At rest it is the same soft blob with its face. When it starts thinking, the face fades, the blob firms up into a 2 × 2 cube and it turns its layers like a puzzle. When the work is done it solves the cube, turns it 45° into the Once UI mark for a beat, and softens back into the blob with its face, a little happier.

sides colors the cube: classic keeps the puzzle colors with the front in the mascot's color, tints uses shades of it, mono paints every side the same, or pass a color per side. face="flat" draws the eyes, brows and mouth flat on the body; surface="flat" turns the light off, so the shape is one solid color. Everything else from the flat mascot carries over.

The cube draws with WebGL and no extra dependency. It only animates while it is on screen, and where WebGL is missing it renders the flat mascot instead.

D20

working="d20" works the same way with a twenty-sided die. While it thinks, the blob firms into the die and tumbles, now slow, now in a quick spin. When the work is done it lands with a face toward you, point up, holds it for a beat and softens back into the blob with its face. The die takes the mascot's color, and every look prop carries over; sides only applies to the cube.

LogoSpinner

The four tiles of the Once UI mark, moving. twist parts the tiles, turns a quarter and clicks them back; wave lifts one tile at a time. Keep Spinner for buttons and fields, and use this one where the product's own loader belongs.

Accessibility

WorkingIndicator is one status region with a fixed name, "Working" unless you pass aria-label, so a screen reader announces it once instead of reading every new verb. With reduced motion the tiles stop moving and fade in turn, the verbs swap without sliding and the shimmer is off.

VoiceVisualizer is a status region that announces its state ("Listening", "Speaking"). With reduced motion its stand-in animations stop; real audio still shows, as glow on the orb and as bar height, because that is feedback the person needs while they talk.

Mascot is one image named for what it is doing ("Assistant, thinking"). With reduced motion it holds still and keeps its poses and expressions; it does not blink, bob or pulse on its own, and the cube shows while it thinks but does not turn.

API reference

Type
Default
verbs
The words to cycle through. Defaults to workingVerbs.
readonly string[]workingVerbs
label
A fixed line instead of the cycling verbs.
ReactNode—
interval
Milliseconds each verb stays.
number2800
shuffle
Random order, never the same verb twice in a row.
booleantrue
shimmer
A light sweep across the words.
booleantrue
showElapsed
Show seconds since startedAt.
booleanfalse
startedAt
When the work began, as a Date or epoch milliseconds.
Datenumber
—
detail
Quiet text after the verb.
ReactNode—
loader
The loader before the words; false for none.
ReactNodefalse
—
size
Text and loader size.
sml
m
aria-label
What screen readers announce once.
string—
…and every LeafProps propinherited—
Type
Default
state
idle, listening, thinking or speaking.
idlelisteningthinkingspeaking
idle
variant
orb or bars.
orbbars
orb
level
Loudness from 0 to 1; takes precedence over source.
number—
source
A MediaStream, an audio or video element, or an AnalyserNode.
AudioLevelSourcenull
—
size
s, m, l or xl.
smlxl
m
tone
brand, accent or neutral.
brandaccentneutral
brand
bars
Number of bars in the bars variant.
number5
aria-label
What screen readers announce; defaults to the state.
string—
…and every LeafProps propinherited—
Type
Default
working
cubed20
—
effects
booleanMascotEffect[]
—
poke
boolean—
state
idle, listening, thinking, speaking or sleeping.
idlelisteningthinkingspeakingsleeping
—
mood
neutral, happy, surprised, sad, skeptical, wink, focused or determined.
MascotMood—
seed
Picks a whole look (mascotLook): known words set colour, body, face and accessories, the hash the rest; props you pass win over it.
stringnumber
—
canonical
boolean—
accessory
antenna, bow, beanie, headphones, sprout, helmet, crown, catEars or partyHat, a list of them, or your own SVG in the 200 × 200 box.
MascotAccessoryMascotAccessory[]React.ReactNode
—
accessoryColor
One color for the built-in accessories, in place of each one's own.
stringPartial<Record<MascotAccessory, string>>
—
accessoryMark
string—
shadow
The soft floor shadow under the mascot. On by default; false hides it.
boolean—
layers
readonly MascotIdentityLayer[]—
username
string—
skinSource
string—
faceAccessory
Your own SVG on the face (a beak, a nose, glasses), in the 200 × 200 box. Follows the gaze, poses and pokes.
React.ReactNode—
lookAt
pointer, center, or a direction from -1 to 1.
pointercenter{ x: number; y: number }
—
level
Loudness from 0 to 1 that makes the body pulse while speaking.
number—
source
Audio to pulse with: an element, a stream or an AnalyserNode.
AudioLevelSourcenull
—
size
s, m, l, xl, a number on the spacing scale, or a CSS length.
smlxlnumberCSSUnit
—
aria-label
What screen readers hear.
string—
color
brand, accent, neutral or any CSS color; every shade comes from it.
brandaccentneutral(string & {})
—
roundness
0, a rounded square, to 1, a circle.
number—
aspect
Width over height: below 1 is tall, above 1 is wide.
number—
bodyPath
Your own outline: an SVG path in a 200 × 200 box.
string—
surface
glossy, matte, flat or glass.
glossymatteflatglass
—
eyes
tile (Once UI, turns while thinking), pill, round, wide, dot, or { path }.
tilepillroundwidedot{ path: string }
—
eyeSize
Scale of the eyes, 1 by default.
number—
eyeSpacing
Distance between the eyes, 1 by default.
number—
eyeHeight
-1 (up) to 1 (down).
number—
eyeColor
Color of the eyes and features.
string—
mouth
none, smile, dot or line; follows the mood and moves while speaking.
nonesmiledotline
—
brows
Brows that follow the mood.
boolean—
cheeks
Blush under the eyes.
boolean—
personality
calm, default or bouncy.
calmdefaultbouncy
—
sides
classictintsmonoPartial<Record<"top" | "front" | "right" | "bottom" | "back" | "left", string>>
—
face
3dflat
—
medium
pixelvectorfurplushclaylowpolytoon
—
…and every LeafProps propinherited—
Type
Default
size
Loader size, the same footprint as Spinner.
sxllmxs
m
variant
twist or wave.
twistwave
twist
tone
brand, accent, neutral, or inherit for the text color.
neutralbrandaccentinherit
brand
speed
Seconds per cycle.
number—
aria-label
What assistive tech announces.
string—
…and every LeafProps propinherited—
Edit this page on GitHub