Skip to content
esc

Avatar

Data displayshadcn/ui

A person's or company's picture in a circle, with initials as the fallback.

When to use

  • Always include AvatarFallback with one or two initials.
  • Use it as the leading element of a ListItem for people and merchants.
  • Don't use it for generic icons; use a plain icon tile.
  • Don't square it.

Accessibility

Role
img
Keyboard
Not focusable.
Notes
Give AvatarImage an alt with the name, or alt='' when the name is next to it.

Props

  • size= 'default'

    'sm' | 'default' | 'lg'

    Diameter.

Prompt for your agent

Use the UnbuiltUI Avatar. Call unbuilt_get_component("Avatar") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

3 variants2 states1 prop4 usage rules2 a11y notes2 tokens1 example

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/avatar.json

Tokens · 2

bg.subtlefg.muted