Skip to content
Sign upPro
VoicePresence pillMenu

Presence pill (Pro)

Free with an account

The voice presence as a floating capsule. A dot at rest, a pill with the orb, the state word and a live meter while you talk, a card with the transcript and tool chips when there is something to show. One shape that springs between the three.

ProA calendar screen with the voice pill at its foot: a dot that grows into a pill while you talk and into a card with the transcript and a tool chip, then shrinks back.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/presence-pill

Free with an account

Sign up with your email and this command works. You also get the Dither orb and the Notch chat. No card.

Sign up free

Usage

tsx
import { PresencePill } from "@/components/ui/chatcn/pro/presence-pill"

<div className="pointer-events-none fixed inset-x-0 bottom-6 flex justify-center">
  <PresencePill
    state={voice.state}
    inputLevel={mic.getLevel}
    outputLevel={agent.getLevel}
    transcript={voice.lines}
    tools={voice.tools}
    muted={voice.muted}
    onMutedChange={voice.setMuted}
    onStart={voice.start}
    onEnd={voice.end}
  />
</div>

Position is yours: put it in a full width row at the edge of the screen and pass the anchor it sits on, so it grows away from that edge. It lays itself out at the size of the card (320 by 168 px, or the width less 24 px when that is narrower) and only the visible capsule takes the pointer, so the space around it stays clickable.

With form="auto" the state picks the form. Connecting, listening and thinking show the pill. Speaking shows the card once the transcript has text. A running tool shows the card in any state. Idle, muted and error hold the pill for 1.6 s after the last change and then rest as a dot; an error dot turns red. Pressing the dot opens the pill and calls onStart.

The core is the free voice orb at 28 px. Pass core to use any orb that takes the effect orb props: core={(props) => <DitherOrb {...props} />}.

Examples

Every form and state

ProEach form in each state that shows it, a custom core, the top anchor, muted, error and a 320 px container.

Props

PropTypeNotes
stateVoiceOrbStateidle, connecting, listening, thinking, speaking, interrupted, muted, error
level, inputLevel, outputLevelnumber | () => number0 to 1. The meter follows the input, the core both sides
simulatebooleanSimulated voices where no level is passed
form"auto" | "dot" | "pill" | "card"Default auto
anchor"top" | "center" | "bottom"The edge it sits on. Default bottom
core(props) => ReactNodeThe orb inside. Default the free voice orb
transcript{ role, text, final? }[]The last three lines show. Lines with final: false show at 60%
tools{ id, label, state: "running" | "done" | "error" }[]One row of chips. A done chip shows its check for 1.2 s, then leaves
muted, onMutedChangebooleanControlled or not
onStart, onEnd() => voidThe dot starts; End and Escape end
labelsPartial<PresenceLabels>Every state word and button name
reducedMotionbooleanDefaults to the user's setting

Keyboard

KeyAction
TabThe dot, then mute and end in the pill and the card
Enter or SpaceStart, mute or end
EscapeEnd the session while focus is inside

Accessibility

  • The root is a group named "Voice". The state word sits in a polite live region; the transcript is not announced, your app's own transcript does that.
  • The dot is a button named "Start voice"; in the error state it also says what happened. Mute is a toggle with aria-pressed. End is a button that stays in the tab order of the pill and shows when it takes focus.
  • When a form leaves while a control inside it has focus, focus moves to the next form's first control, or holds on the group until there is one.
  • Hit areas grow to 44 px on touch. In forced colors the capsule keeps a solid outline that follows its shape, the meter and the pressed mute stay visible, and an error dot fills.
  • On a dark page the resting dot lifts to a mid gray, so the start button stands off the page; it takes the capsule's surface again as it grows. When focus falls back to the group, a ring goes round the shape.

Motion

  • The capsule is one element at the card's size, and what you see is a clip-path cut out of it. Width, height and radius ride critically damped springs (stiffness 260 growing, 320 shrinking), so nothing overshoots, and a change midway continues from where the shape is, with its speed.
  • Content never squeezes. The core, the word, mute and end sit on the corner circles and ride the corners out to the card and back, but never closer together than in the resting pill. Content that leaves fades out in 90 ms with a 4 px blur before the shape shrinks. Content that arrives is laid out at its final size and starts fading in from a 4 px blur and 96% once the shape has covered 15% of its travel, over 160 ms, so it is uncovered by the growing edge instead of waiting for it. Leaving the card, the state word changes only once the shape is shrinking toward the pill.
  • End appears on hover by widening the pill, never by covering the meter. The state word crossfades with a 2 px blur at the crossing.
  • The dot breathes, 1 to 1.12 over 2.4 s, only while idle. Reduced motion jumps the shape, crossfades content in 120 ms without blur, and stills the dot and the meter.
  • Nothing runs unseen: the breath and the meter stop off screen and in a hidden tab, and the meter only reads a level when one is passed or simulated.