Avatar
A visual representation of a user or entity, typically displayed as a profile picture, icon, or initials.
API Reference
Usage
Properties
The Avatar component extends the Bits UI <Avatar> component. Find the full list of available properties in the official Bits UI documentation.
Avatar
| Prop | Type | Default |
|---|---|---|
color | string | neutral |
size | string | md |
image | string | - |
fallback | string | - |
AvatarGroup
| Prop | Type | Default |
|---|---|---|
gap | string | md |
Examples
Icon
The icon is displayed when neither a fallback text or an image source is provided. In this case, the avatar will show a default user icon.
Fallback
When an image is not provided, the avatar displays a fallback text instead. This is commonly used to show initials of a user's name.
Sizes
The size property controls the dimensions of the avatar.
Colors
The color property controls the background color of the avatar when no image is provided.
Group
Use the AvatarGroup component to display multiple avatars together. The gap property controls the spacing between the avatars.