Call Menu
A small round picture of who you'd call, opening a menu to start a video call or a voice call.
Installation
npx shadcn@latest add "@aiellie/call-menu"shadcn needs the @aiellie registry in components.json first. npx aiellie add call-menu adds it on its first run, then installs the same way.
Call Menu starts a call from a chat: a small round picture of who you'd call, opening a menu with a video call and a voice call.
Getting started
Start the call
Each row calls its handler when picked.
components/chat-header.tsximport { CallMenu } from "@/components/aiellie/call-menu" <CallMenu name="Ellie" src="/ellie.png" onVideoCall={() => startCall({ video: true })} onCall={() => startCall({ video: false })} />
Anatomy
<button data-slot="call-menu" aria-label="Call Ellie">
<span data-slot="avatar" />
</button>
<div data-slot="menu-content">
<div data-slot="menu-item" /> {/* Video call */}
<div data-slot="menu-item" /> {/* Call */}
</div>It's built on our menu, so it opens from the keyboard and closes on Escape. The trigger keeps its focus edge while the menu is open.
Examples
More rows
Children go under the two calls.
API reference
CallMenu
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | required | Who the call is with. |
src | string | Their picture. | |
onVideoCall, onCall | () => void | ||
videoLabel | string | "Video call" | |
callLabel | string | "Call" | |
children | ReactNode | More menu rows. | |
className | string | Merged onto the trigger. |