Prepared Docs

Prepared Docs

⌘K

    Loading navigation…

User

  1. Components
  2. Avatar
  3. API and Development

Avatar

API and Development

View Source
Submit Issue

Avatar represents people and entities across the product. It supports images and text fallback.

Props

Name

Type

Default

Description

alt

string

—

Alt text for the avatar image. First character is used as the fallback when no fallback prop is provided.

color

AvatarColor

AvatarColor.Default

Color variant for the fallback background.

fallback

ReactNode

—

Content displayed when the image fails to load or no src is provided. Defaults to the first character of alt.

inverted

boolean

—

When true, applies inverted text color styling for use on dark backgrounds.

size

AvatarSize

AvatarSize.Regular

Controls the avatar dimensions.

square

boolean

false

When true, renders the avatar with rounded-square corners instead of a circle.

src

string

—

URL of the avatar image.

Storybook

Interactive examples and edge cases for this component are in Storybook.

Default
Small
Regular
Large
Accent
Square
With Image
Custom Fallback
All Sizes
All Variants

Sizes

Avatar supports three sizes for different layout needs—Small, Regular, and Large.

Small

Use Small in compact layouts, such as lists or dense UIs.

Regular

Default is suitable for most contexts.

Large

Use Large when the avatar is a focal point, such as profile views.

Colors

Color variants help convey emphasis or state.

Default

Default is standard color for most use cases.

Accent

Use Accent for active, live, or otherwise emphasized avatars.

Shapes

Choose a shape that matches the context.

Circular

The default shape, Cicle, is appropriate for people avatars.

Square

Use Square for organizations or when a more structured look is desired.

Content types

Avatar adapts based on the data provided.

Image

Image displays a profile image when src is provided.

Text fallback

The fallback feature automatically shows the first character of alt when no image is available.

Custom fallback

Provide explicit fallback content for greater control.

Previous

Avatar / Usage

Next

Avatar / Accessibility

On this page

Props
Storybook
Sizes
Small
Regular
Large
Colors
Default
Accent
Shapes
Circular
Square
Content types
Image
Text fallback
Custom fallback