Skip to content
English
Live pill comes with Pro. Its preview shows once you unlock it.

How it works

A fully round pill for something live: an assistant speaking or listening, a recording, reading aloud. The left side holds the title, the context, the level bars and the state; the right side is a canvas of three folds of light, the back ones softer and slower, the front one bright. The light fades into the text side without an edge. Press the pill to pause or resume. The component accepts a real level or supplies its own gentle rhythm.

Use it for

  • Show voice replies, recordings, streams or other ongoing tasks that can be paused.

Usage

import { LivePill } from './LivePill.jsx'

<LivePill
  title="Speaking"
  subtitle="Voice reply"
  tone="ink"
  playing={isSpeaking}
  level={audioLevel}
  onToggle={setIsSpeaking}
/>

Props

PropTypeDefaultWhat it does
titlestring'Live activity'The activity name, shown on the first line and included in the accessible name.
subtitlestring'Voice session'Context on the second line, before the level bars and the state. Pass an empty string to show only the bars and the state.
tone'ink' | 'accent' | 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5' | 'chart-6' | 'chart-7' | 'chart-8''ink'Ink is a dark pill whose light splits into prism colours from the chart tokens; it stays dark in the dark theme. Accent and chart tones draw pastel folds of that one colour on the normal surface, and glowing ones on a dark surface.
size'sm' | 'md''md'64px or 44px tall. The native button inside is 44px tall and the whole pill is its hit area.
playingboolean—Controlled activity state. Update it when the activity actually pauses or resumes.
defaultPlayingbooleantrueInitial state when playing is omitted.
onToggle(next: boolean) => void—Receives the requested playing state when the button is activated.
levelnumber—A normalized input from 0 to 1 sets the height of the bars and the thickness of the light. Omit for a gentle automatic pulse.
labels{ live?: string; paused?: string; name?: (data: LabelData) => string; announce?: (data: LabelData) => string }—Replace state text, the accessible name and pause/resume announcements. LabelData contains title, subtitle, status and playing.
motionPausedbooleanfalseHold the decorative motion on its current frame while preserving the activity state.

Accessibility

  • Tab focuses the native button, and the focus ring wraps the whole pill. Enter, Space, a click or a tap anywhere on the pill activates it.
  • The accessible name includes the state. The change is announced politely, and the state is written next to the level bars, not shown by colour alone.

Motion

The light and the bars share one animation loop for every pill on the page. A paused activity coasts to a stop over 900ms while the light dims and the bars settle; a resumed one gathers speed over 360ms. A press squashes the pill slightly and it springs back. Offscreen pills and hidden tabs stop drawing. Reduced motion keeps the light and the bars still and removes the squash.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

LivePill.jsxlive-pill.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Feedback
Confetti burst comes with Pro. Its preview shows once you unlock it.