Contact Button
Who you're talking to, at the top of a chat: their picture over a pill with their name, opening more about them.
Ellie answers in this chat, and remembers what you tell her.
Installation
npx shadcn@latest add "@aiellie/contact-button"shadcn needs the @aiellie registry in components.json first. npx aiellie add contact-button adds it on its first run, then installs the same way.
Contact Button is who you're talking to, at the top of a chat: their picture with their name in a pill beneath it, which opens more about them. It works for an assistant or a person.
Getting started
Open their details
It's a button, so wire it to whatever shows their details, and pass
aria-expandedandaria-controlswhen it opens a panel.components/chat-header.tsximport { ContactButton } from "@/components/aiellie/contact-button" export function ChatHeader({ open, onOpenChange }: Props) { return ( <ContactButton name="Ellie" emoji="🐘" src="/ellie.png" aria-expanded={open} aria-controls="info-panel" onClick={() => onOpenChange(!open)} /> ) }
Anatomy
<button data-slot="contact-button" aria-label="About Ellie">
<span data-slot="avatar" />
<span /> {/* the pill: emoji, name, chevron */}
</button>The picture overlaps the top of the pill. Focus shows on the pill's edge, and the pill stays filled while aria-expanded is true.
Examples
Without a picture
Their initials stand in.
API reference
ContactButton
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | required | Also names the button. |
src | string | Their picture. | |
emoji | string | Set before the name. |
All other button props are forwarded.