aiellie

Search

Find a component, template or page

GitHub
Components

Call Menu

A small round picture of who you'd call, opening a menu to start a video call or a voice call.

fig. 01 · open it full screen from the corner

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

  1. Start the call

    Each row calls its handler when picked.

    components/chat-header.tsx
    import { 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

PropTypeDefaultDescription
namestringrequiredWho the call is with.
srcstringTheir picture.
onVideoCall, onCall() => void
videoLabelstring"Video call"
callLabelstring"Call"
childrenReactNodeMore menu rows.
classNamestringMerged onto the trigger.