Installation
- Tab Title
- Tab Title
Usage
Examples
Sizes
Avatars support six sizes from3xs to l.
Shapes
Choose between circular (default) and square shapes.Image with Fallback
When an image fails to load, avatar shows initials or icon fallback.Initials
Display up to 2 characters as initials (automatically uppercased).Custom Icon
Provide a custom icon for the fallback.Decorative Colors
Use withisEmphasized to apply decorative background colors.
Avatar Group
Display multiple overlapping avatars with overflow count.API Reference
Avatar
Size of the avatar:
3xs, 2xs, xs, s, m, l.Shape of the avatar:
circular, square.Image source URL.
Alt text for the image.
1-2 characters to display as fallback. Automatically uppercased and limited to 2 characters.
Custom icon element for fallback. Defaults to user icon.
Fallback type to display when image fails:
initials, icon.When
true, applies border and allows color customization.Decorative color (requires
isEmphasized): red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose.Explicit escape hatch for intentional structural overrides.
AvatarGroup
Size applied to all child avatars:
3xs, 2xs, xs, s, m, l.Maximum number of avatars to display. Additional avatars show as ā+Nā overflow count.
Avatar components to group.
Explicit escape hatch for intentional structural overrides.
Accessibility
- Always provide
alttext for images - Initials are visible to screen readers
- Fallback icons use
aria-hiddenwhen initials/images are present - Use semantic color variants for status indicators when possible
Design Tokens
Avatar uses design tokens for consistent styling:- Spacing:
--space-*for sizes - Border radius:
--radius-8(square),--radius-max(circular) - Colors:
--color-utility-avatar,--color-surface-decorative-*,--color-border-decorative-* - Typography:
--font-size-*,--line-height-*,--font-weight-medium