A quick call as a bar that docks under the sidebar, or a stage with a tile per person.
- MP
- DR
- BO
- MC
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import { Call, CallLayout } from "./ui/uicontext/components/kit/Call.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, radius } from "./ui/uicontext/components/tokens.stylex.ts"import { callers, now } from "./chat.ts"const styles = stylex.create({ bar: { inlineSize: "min(100%, 17rem)" }, stage: { blockSize: 420, inlineSize: "min(100%, 48rem)", overflow: "hidden", borderRadius: radius.lg }, left: { margin: 0, fontSize: font.sm, color: color.muted },})const Message = UiSchema.TaggedEnum({ Muted: { muted: Schema.Boolean }, Video: { on: Schema.Boolean }, Shared: { on: Schema.Boolean }, Left: {}, ChangedLayout: { layout: CallLayout },})// Mute, camera and share; the arrows open the call full size and dock it back; Leave ends it hereexport const DesignReviewCall = Html.component({ name: "DesignReviewCall", model: Schema.Struct({ muted: Schema.Boolean, video: Schema.Boolean, sharing: Schema.Boolean, layout: CallLayout, left: Schema.Boolean }), message: Message,}).make({ init: () => ({ muted: false, video: false, sharing: false, layout: "bar" as const, left: false }), update: { Muted: ($, { muted }) => $.evolve({ muted }), Video: ($, { on }) => $.evolve({ video: on }), Shared: ($, { on }) => $.evolve({ sharing: on }), Left: ($) => $.evolve({ left: true }), ChangedLayout: ($, { layout }) => $.evolve({ layout }), }, view: (h, model) => model.left ? h.p.attrs({ role: "status", ...sx(styles.left) }).children("You left the call.") : h.div.attrs(sx(model.layout === "bar" ? styles.bar : styles.stage)).children(Call(h, { props: { layout: model.layout, title: "#design-crit", participants: callers.map((p) => (p.id === "maya" ? { ...p, muted: model.muted, video: model.video, sharing: model.sharing } : p)), muted: model.muted, video: model.video, sharing: model.sharing, startedAt: "2026-12-01T14:48:00Z", 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 }), }, })),})Installation
pnpm dlx shadcn@latest add checkfu/uicontext/callUsage
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
import type { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Call } from "./ui/uicontext/components/kit/Call.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { radius } from "./ui/uicontext/components/tokens.stylex.ts"import { callers, now } from "./chat.ts"const styles = stylex.create({ frame: { blockSize: 440, inlineSize: "min(100%, 52rem)", overflow: "hidden", borderRadius: radius.lg },})// Full size: Mira shares her screen, so it leads, wide; a ring shows who's speakingexport const CallStage = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.frame)).children(Call(h, { props: { agentId: "call-stage", layout: "stage", title: "#design-crit", participants: callers.map((p) => (p.id === "mira" ? { ...p, sharing: true } : p)), muted: true, video: false, sharing: false, startedAt: "2026-12-01T13:52:00Z", now, }, onEmit: { RequestedMute: () => undefined, RequestedVideo: () => undefined, RequestedShare: () => undefined, RequestedLeave: () => undefined, RequestedLayout: () => undefined }, }))API reference
Props
| Name | Type | Description |
|---|---|---|
layoutrequired | CallLayout | — |
titlerequired | string | Where the call is: "#design-crit", "Mira Patel" |
participantsrequired | CallParticipant[] | Everyone in the call, the reader included |
mutedrequired | boolean | The reader's own controls |
videorequired | boolean | — |
sharingrequired | boolean | — |
startedAtrequired | string | When the call started and the time now, both ISO: how long it's run |
nowrequired | string | — |
agentId | string | — |
Events
| Event | Payload | Description |
|---|---|---|
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
| Action | Description |
|---|---|
ClickedMute | Mute or unmute the reader |
ClickedLeave | Leave 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.