AvatarLabelGroup
<AvatarLabelGroup>TailwindCSS ModulesCombines an Avatar with a title and optional subtitle text. Handles text truncation automatically.
npx coloxo add avatar-label-group --style coloxo-cssimport { AvatarLabelGroup } from '@coloxo/ui';Design Tokens:
1. Variant Matrix
AvatarLabelGroup supports all Avatar props (images, initials, statuses, squircle shapes).
| Image (Title + Subtitle) | Initials (Title Only) | Status Indicator | Squircle | |
|---|---|---|---|---|
| Default | Olivia Rhye olivia@untitledui.com | Olivia Rhye | Olivia Rhye olivia@untitledui.com | Olivia Rhye olivia@untitledui.com |
2. Control heights (Sizes)
Supports 3 specific sizes that scale both the avatar diameter and the typography together.
Sizes
size="sm"Olivia Rhye
olivia@untitledui.com
Dropdown menus, dense lists
size="md"DEFAULTOlivia Rhye
olivia@untitledui.com
Standard tables, page headers
size="lg"Olivia Rhye
olivia@untitledui.com
Profile cards, hero sections
3. Interactive Props Configurator
Include Subtitle
Rounded Avatar
Olivia Rhye
olivia@untitledui.com
<AvatarLabelGroup title="Olivia Rhye" subtitle="olivia@untitledui.com" src="https://i.pravatar.cc/150?u=a042581f4e29026704a"/>4. Dark theme
Typography and avatar borders automatically adapt to dark backgrounds.
Olivia Rhye
olivia@untitledui.com
5. Enterprise layout compositions
Truncation is built-in. If the container is too narrow, the title and subtitle will automatically append an ellipsis (...).
Narrow Container (200px)
Christopher Columbus
christopher.columbus@longdomainname.com
Accessibility
The wrapper uses HTML <figure> and <figcaption> elements, providing standard semantic relationships between the avatar image and its label text.
When text truncates via CSS ellipsis, ensure a native `title` attribute or tooltip is provided if the full text cannot be inferred elsewhere.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| title | ReactNode | — | Primary label. |
| subtitle | ReactNode | — | Secondary label. |
| size | "sm" | "md" | "lg" | md | Avatar + type scale. |