Avatar
An image element with a fallback for representing the user.
Usage
<div class="flex items-center gap-4">
<ui-avatar>
<ui-avatar-fallback>CN</ui-avatar-fallback>
</ui-avatar>
<ui-avatar>
<ui-avatar-fallback>AB</ui-avatar-fallback>
</ui-avatar>
</div>
Sub-components
<ui-avatar> <ui-avatar-image> <ui-avatar-fallback> <ui-avatar-badge> <ui-avatar-group> <ui-avatar-group-count>
Props
<ui-avatar>
| Prop | Type | Default | Description |
|---|
size | "default" | "sm" | "lg" | "default" | The size of the avatar. |
<ui-avatar-image>
| Prop | Type | Default | Description |
|---|
src | string | — | The image source URL. |
alt | string | — | Alt text for the image. |
All components also accept standard HTML attributes (class, id, style, data-*, aria-*, etc.) which are passed through to the underlying element.