Call

A quick call as a bar that docks under the sidebar, or a stage with a tile per person.

  • MP
  • DR
  • BO
  • MC

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/call

Usage

import { Call, CallLayout, type CallParticipant } from "./ui/uicontext/components/kit/Call.ts"
const Message = UiSchema.TaggedEnum({	Muted: { muted: Schema.Boolean },	Video: { on: Schema.Boolean },	Shared: { on: Schema.Boolean },	Left: {},	ChangedLayout: { layout: CallLayout },})export const CallBar = (h: Html.H<typeof Message.Type>, participants: ReadonlyArray<CallParticipant>, muted: boolean, startedAt: string, now: string) =>	Call(h, {		props: { layout: "bar", title: "#design-crit", participants, muted, video: false, sharing: false, startedAt, now },		onEmit: {			RequestedMute: ({ muted }) => Message.Muted({ muted }),			RequestedVideo: ({ on }) => Message.Video({ on }),			RequestedShare: ({ on }) => Message.Shared({ on }),			RequestedLeave: () => Message.Left(),			RequestedLayout: ({ layout }) => Message.ChangedLayout({ layout }),		},	})

Examples

Stage

#design-crit

4 people · 1 hr 8 minMira Patel speaking
  • Mira Patel is sharing their screen
  • MPMira Patel
  • DRDana Ruiz
  • BOBen Okafor
  • MCMaya Chen

API reference

Props

Call props
NameTypeDescription
layoutrequiredCallLayout—
titlerequiredstringWhere the call is: "#design-crit", "Mira Patel"
participantsrequiredCallParticipant[]Everyone in the call, the reader included
mutedrequiredbooleanThe reader's own controls
videorequiredboolean—
sharingrequiredboolean—
startedAtrequiredstringWhen the call started and the time now, both ISO: how long it's run
nowrequiredstring—
agentIdstring—

Events

Call events
EventPayloadDescription
RequestedMute{ muted: boolean }—
RequestedVideo{ on: boolean }—
RequestedShare{ on: boolean }—
RequestedLeave{}—
RequestedLayout{ layout: CallLayout }Open the call full size, or dock it back into a bar

Agent actions

What agents can do with Call
ActionDescription
ClickedMuteMute or unmute the reader
ClickedLeaveLeave the call

Accessibility

  • The call is a region named for where it is. Mute, camera and share are toggle buttons; Leave and Open are named buttons.
  • Who's speaking is announced politely; each person's tile or face says when they're muted or speaking.

Source