voicedock
ui component for voice sessions
the control bar of a live voice session, beads on one thread, shown at actual size.
Connected
actual size
states
size
look
install
a react component: the command at the top installs it, or copy its two files. the dock only draws: the session, the microphone and the menu stay in your app, and it tells you through the callbacks what the user pressed.
import { useState } from "react";
import { VoiceDock } from "@likemiens/voice-dock"; // brings voice-dock.css with it
export function CallBar({ call, labels }) {
const [muted, setMuted] = useState(false);
const [sharing, setSharing] = useState(false);
const [menuOpen, setMenuOpen] = useState(false);
return (
<VoiceDock
status={call.status} // "connecting" | "live" | "reconnecting" | "ended"
muted={muted}
sharing={sharing}
menuOpen={menuOpen}
level={() => call.level()} // 0…1, read every frame
size={42}
appearance="glass" // or "flat"
labels={labels}
onMutedChange={setMuted}
onSharingChange={setSharing}
onMenuOpenChange={setMenuOpen}
onExit={() => call.leave()}
/>
);
}githubMIT
api
props
statusconnecting · live · reconnecting · endedthe session, shown by the dot and its word; ended folds every bead into the firstmutedbooleanthe microphone is off: a slash is drawn across the waveformsharingbooleanthe screen is shared: the window lights upmenuOpenbooleanthe menu bead is open; the menu itself is yours to renderlevel0…1 · () => 0…1the voice; a function is read every frame, so a meter re-renders nothingarmedboolean, optionalexit waits for its second press; leave it out and the dock keeps it, letting go after 4 ssize36 · 42 · 48the height of a bead, 48 by default; the whole dock zooms, tooltips keep their sizeappearanceglass · flatglass, the default: smoked glass tinted bead by bead with the colour of its state, lit icons and words; flat: the plain greylabelsVoiceDockLabelsevery word the dock shows or says to a screen readercallbacks
onMutedChange(muted) => voida press on the microphoneonSharingChange(sharing) => voida press on the screenonMenuOpenChange(open) => voida press on the menu beadonArmedChange(armed) => voidexit asks once more, or lets goonExit() => voidthe second press of exit; set status to ended to fold the dockkeyboard
← → home endbetween the beadsenter spacepressesctakes exit back, closes the menucolours
--vd-surfaceglass—flat#eaebe9--vd-glassglassrgb(24 24 27 / 92%)flat—--vd-inkglassrgb(255 255 255 / 92%)flat#3f4247--vd-quietglassrgb(255 255 255 / 30%)flat#caccc9--vd-liveglass#4ade80flat#5eb948--vd-warnglass#facc15flat#e8a13a--vd-dangerglass#fb7185flat#e5484d--vd-shareglass#38bdf8flat--vd-live--vd-focusglass#7cc4ffflat#0c75f1