Components
Avatar
Displays a user's profile image with a fallback to initials or an icon when unavailable.
Stable
GitHubAnatomy
Anatomy
import {Avatar} from '@staffbase/design';
<Avatar.Group>
<Avatar.Root>
<Avatar.Image />
<Avatar.Fallback />
</Avatar.Root>
<Avatar.GroupCount />
</Avatar.Group>;Examples
Sizes
JDTBKPLHAW
Icon fallback
Group
U1U2U3
+4
API reference
Root
Inherits props fromBase UI Avatar Root
| Name | Type | Description |
|---|---|---|
size | 4840322416 | The size of the avatar in pixels. Default: 40 |
Image
Inherits props fromBase UI Avatar Image
| Name | Type | Description |
|---|---|---|
src | string | The URL of the avatar image. |
alt | string | Accessible description of the image for screen readers. |
Fallback
Inherits props fromBase UI Avatar Fallback
| Name | Type | Description |
|---|---|---|
name | string | Derives a consistent fallback colour from the user's name. The same name always maps to the same colour. Omit to show a grey background with no derived colour. |
children | ReactNode | Fallback content — typically two-character initials, or an icon when no user identity is available. |
Group
GroupCount
When to use
When not to use
How to use
Structure
Sizes
JDTBKPLHAW
Fallback
Group
U1U2U3
+4