Murmur
Playground
State
Colour
Input level only drives the listening state.
import { Murmur } from "@shavin/ui";
<Murmur state="thinking" size={96} />Install
npm install @shavin/uiimport { Murmur } from "@shavin/ui";Works with
React
Client component; Next.js and any React 18+ app
Remotion
Murmur animates on its own loop, so it is for live pages; it does not follow FxTimeProvider yet.
States
idle
thinking
working
listening
searching
composing
weaving
connecting
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| state | "idle" | "thinking" | "working" | "listening" | "searching" | "composing" | "weaving" | "connecting" | "thinking" | Which motion. "orbiting" and "looping" are the loaders; a name added with registerMurmurState also works, and an unknown name falls back to "thinking". |
| size | number | 24 | Diameter in px. |
| level | number | 0 | Live input level 0 to 1; drives "listening". |
| speed | number | 1 | Speed multiplier. |
| dots | number | auto | Dot count; scales with size by default. |
| dotSize | number | 0.4 | Dot size multiplier. |
| label | string | the state name | Accessible name (role="img"). Pass "" to hide it from assistive tech when a visible label sits beside it. |
| className | string | - | Colour via a text colour class, e.g. text-success; the dots use currentColor, text-brand-contrast by default. |
Murmur is a free component in @shavin/ui. It draws to a canvas, skips drawing while off screen and holds a still frame under prefers-reduced-motion. It is also documented on the Murmur component page. The loader states (orbiting, looping) are on the Dot loaders page.
Anatomy
import { Murmur, registerMurmurState } from "@shavin/ui";
<Murmur state="searching" size={24} />
// Your own state: a function per dot, per frame
registerMurmurState("pulse", (dot, frame, out) => { /* write out.x/y/z/size/alpha */ });