Component size, gzipped: 12kb

Avatar

Loading
API

Adds additional visual information about a user.

When to use

  • When you want to show a user's image along contextual information.
  • When you want to attribute an action to a user.

Accessibility

  • Top level name prop will be set on the <img> element as its alt attribute.
  • If src fails to load, applies aria-label with provided name and role with 'img' to root div element.

Examples

Avatar with available sizes

user
user
user
user
user

Avatar with error fallback

user
user
user
user
user

Avatar with initals

Avatar with example overrides

user name #1
beyonce knowles
user name #3
beyonce knowles

API

Avatar exports

You can import this module like so:

import {Avatar} from 'baseui/avatar'

It exports the following components or utility functions: