AI sparkPro
A little star glyph that signals machine work: four long points and four short paler ones swell gently when resting, send a wave round while thinking, pulse while writing and draw together when finished, always easing from wherever they were.
oxyn add ai-sparkThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A compact animated mark that says an AI is at work, for buttons, pills, avatars and inline status.
When not to use
- Replays a multi-agent run on one clock: use Agent timeline instead.
- One model at a glance: use Model card instead.
- A small automation on a single rail: use AI workflow instead.
Installation
AI spark is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add ai-sparkUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Loop
The mark with its pill and avatar.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Pill thinking
The pill, thinking (Oxyn extra: ink tone).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Error
Couldn't finish: short rays, dim diagonals, red.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
AiSpark
| Prop | Type | Default | Description |
|---|---|---|---|
nowrequired | ClockMs | — | Host clock. |
status | String | Default::default() | `idle`, `thinking`, `writing`, `done`, `error`; empty plays the loop. |
variant | String | "mark" | `mark`, `pill` or `avatar`. |
size | f32 | Default::default() | Size in px; 0 picks a default per variant (mark 24, pill 16, avatar 20). |
tone | String | "violet" | `ink`, `muted` or `violet`. |
label | String | Default::default() | Pill text instead of the status word. |
speed | f32 | 1.0 | Speed multiplier. |
paused | bool | Default::default() | Freeze. |
announce | bool | true | Announce status changes (off for decorative copies). |
picker | bool | Default::default() | Status chips (Oxyn extra). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| — | Purely an indicator and never focused; place buttons like Stop next to it. |
Accessibility
- The root is a polite status region announcing changes once (AI is thinking); aria-busy while working.
- Every state has a distinct silhouette as well as movement, failure adds red, and the pill spells the state out.
- Decorative copies set announce off so only one spark speaks.
From the spec
A polite status region announcing changes once (AI is thinking) with aria-busy while working; decorative copies turn announce off. Every action returns the line the polite live region announces. The focus outline shows only for keyboard focus.
Motion & interaction
Every status is a function of time and of the ray's angle, so loops have no seam; a change blends from the pose on screen. The pill label crossfades.
Timing
Everything on screen is derived from the host clock now (no timers in the component), so playback, tests and the GPUI view agree.
| Transition | Duration | Easing |
|---|---|---|
| Status blend | 420 ms | smoothstep |
| Idle breath | 6.4 s | sine |
| Thinking ripple | 1.1 s | sine |
| Writing beat | 0.9 s | gaussian pulses |
Reduced motion: loops and travel stop; each state shows its end pose and its words.
Responsive behaviour
- One footprint for every status, so text around it never shifts.
- Geometry is in a 100-unit box and stays crisp from 12 px up.
Edge cases (spec)
One footprint for every status; crisp from 12 px up (100-unit geometry). Tones: violet, ink, muted. Checked at 1440, 768 and 390 px in light and dark with no text overlap. Chrome is monochrome grey; colour is semantic only (success, warning, danger, info) plus the official coloured brand and model marks.
Notes for AI
- Import
AiSparkfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
AiKitViewinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.