Aster
idle
TRY IT ↓

Try it

A scripted agent wired to Aster the way a real one would be. Every state it goes through — listening, thinking, running a tool, streaming, waiting on you — is passed to emoteFor(). Type, pick a suggestion, approve or cancel, or hit stop mid-reply.

Aster Online

Docs

Aster is a three-stroke agent mascot. One custom element, zero dependencies, MIT licensed. Every emote is driven by springs, so switching never cuts — each stroke glides from wherever it is to the next pose.

Install

npm install aster-mascot

Or straight from a CDN, no build step:

<script type="module" src="https://cdn.jsdelivr.net/npm/aster-mascot@0.3"></script>

Pin the version as above. While Aster is 0.x, a minor release can change behaviour, and an unpinned URL follows whatever is latest.

Size, gzipped (unminified source): /core 6.3 KB · element 9.0 KB · /favicon 8.6 KB · everything 11.2 KB.

Use

<aster-mascot emote="thinking" size="64"></aster-mascot>
<aster-mascot emote="happy" size="48" rounded="false" color="#e4572e"></aster-mascot>
import 'aster-mascot';

const aster = document.querySelector('aster-mascot');
aster.play('success');
aster.addEventListener('aster-emote', e => console.log(e.detail.emote));

Attributes

AttributeDefaultNotes
emoteidleAny emote below.
size64pxNumber (px) or any CSS length. Or set --aster-size.
colorcurrentColorAny CSS color. Or set --aster-color.
speed1Time multiplier.
roundedonRound stroke ends. rounded="false" for flat ends, like the original art.
pausedoffFreeze the animation.
labelAsterAccessible name. The emote is appended, e.g. “Aster, thinking”.
announceoffAnnounce emote changes to screen readers through a polite live region.

Emotes

Click a tile to play it in the hero.

Methods and events

Agents

Map your agent's states to emotes with emoteFor(). Call it as often as you like: repeated calls with the same emote are ignored.

import { emoteFor } from 'aster-mascot';

agent.on('state', state => aster.play(emoteFor(state)));
Agent stateEmoteWhen
idleidleNothing happening.
greetingwaveSession start, first message.
listeninglisteningUser is typing or speaking.
thinkingthinkingModel is reasoning, before output.
toolworkingRunning a tool call.
workingworkingLong task in progress.
streamingspeakingWriting a reply.
waitinglisteningBlocked on the user: approval, question.
approved / deniedyes / no
interruptedsurprised
donesuccessTask finished.
errorerrorTask failed.
cancelledsad
offlinesleepDisconnected, rate-limited, timed out.

Emote names pass through unchanged, unknown states fall back to idle, and emoteFor(state, { ...AGENT_STATES, waiting: 'wave' }) overrides the map.

Accessibility

Behaviour

Frameworks

It's a standard custom element, so it works as-is.

// React 19+
import { emoteFor } from 'aster-mascot';
<aster-mascot emote={emoteFor(agentState)} size="40" announce />
<!-- Vue: compilerOptions.isCustomElement = tag => tag === 'aster-mascot' -->
<aster-mascot :emote="state" size="40" />

Animated favicon

Put Aster in the browser tab. Handy for showing an agent's state while the user is in another tab — this page's own tab icon follows the hero.

import { animateFavicon } from 'aster-mascot/favicon';

const fav = animateFavicon({ emote: 'working' });

// later
fav.play('success'); // no-op if already playing
fav.set({ background: '#111', fps: 15 });
fav.stop(); // restores the page's original favicon
OptionDefaultNotes
emoteidleStarting emote.
fps12Frames pushed to the tab, 1–30.
size64Canvas size in px.
colorautoFollows light/dark mode, or contrasts with background.
backgroundnoneFill behind Aster, e.g. #fff. Rounded square.
radius0.22Background corner radius, fraction of size.
padding0.02Inset around Aster, fraction of size.
roundedonRound stroke ends.
speed1Time multiplier.
pauseWhenHiddenoffStop drawing while the tab is hidden.

Runs on a timer, not requestAnimationFrame, so it keeps going in background tabs. Browsers slow background timers to about once a second, so motion there is choppier by design. Identical frames are skipped, and it honours prefers-reduced-motion.

pauseWhenHidden is off by default because the favicon's job is to show agent state while the user is in another tab. That keeps a timer running there, which costs a little battery; turn it on if the icon only needs to animate while the page is visible.

Engine only

Render Aster anywhere — canvas, React Native, WebGL — with the DOM-free core.

import { createAster, VIEWBOX } from 'aster-mascot/core';

const aster = createAster({ emote: 'idle' }); // rounded by default
function frame(dt) {
  aster.update(dt); // seconds
  for (const { d, width } of aster.paths()) {
    // draw path d, stroke width `width`, cap aster.linecap, in VIEWBOX space
  }
}

License

MIT.