Search/

Avatars

Last modified:

Avatars are used to show a thumbnail representation of an actor (eg. users).

Variants

Example of Avatars - default

React documentation

Last modified:

BcAvatar Props

PropTypeRequired?DefaultDescription
altstringrequiredSets alt text.
srcstringrequiredAvatar source path.
classNamestringoptionalAdd custom CSS class(es).
accentBorderstringoptionalAdds a colored border to the avatar, a Hex color value, leading with a #, like #900000.
backgroundbooleanoptionalfalseSets avatar as background image.
groupedChildbooleanoptionalfalseUses superimpose a smaller, ‘child’ avatar to the top right of the main one.
inlinebooleanoptionalfalseUsed to display avatars as an inline component.
sizestringoptionalSets the size of avatar image.
squarebooleanoptionalfalseShows avatar in squared shape.
styleCSS propertyoptionalSets custom inline styles.

BcAvatar size prop

BcAvatar size prop is optional.

Its sizes are:

size valueDescription
xsMakes it extra-small sized (16×16 px).
smMakes it small sized (24×24 px).
(default)Makes it regular sized (default, 40×40 px).
lgMakes it large sized (72×72 px).
xlMakes it extra-large sized (128×128 px).

Any extended types: No

BcAvatar.Group

Superimposes a smaller ‘child’ avatar to the top right of the main one.

BcAvatar.Group will become parent tag for BcAvatar, when used (see Grouped example below).

BcAvatar.Group Props

PropTypeRequired?DefaultDescription
classNamestringoptionalAdd custom CSS class(es).
inlinebooleanoptionalfalseUsed to display avatars as an inline component.
sizestringoptionalSets the size of avatar image.

BcAvatar.Group size Prop

BcAvatar.Group size prop is optional.

Its sizes are:

Group size valueDescription
xsMakes it extra-small sized, (base image size is 16×16 px,super-imposed image size is 16×16 px).
smMakes it small sized, (base image size is 24×24 px, super-imposed image size is 16×16 px).
(default)Defaults to base image size of 40×40 px, super-imposed image size of 14×14 px.
lgMakes it large sized, (base image size is 72×72 px, super-imposed image size is 24×24 px).
xlMakes it extra-large sized, (base image size is 128×128 px, super-imposed image size is 16×16 px).

Any extended types: No.

HTML

Last modified:

Treat avatar images as document or application content.

Add .bc-avatar to an <img> element.

It can also work for elements with a background-image.

Design

Last modified:

Avatars come in 4 sizes (optically in pixels):

DimensionsModifier
16×16.bc-avatar--xs
24×24.bc-avatar--sm
40×40N/A (default)
72×72.bc-avatar--lg
128×128.bc-avatar--xl

Avatar dimension units are set in rems.

The following variants are available:

VariantPurpose
.bc-avatar--inlineUsed to display avatars as an inline component.
.bc-avatar--squareChanges the rounding of the border radius to be more square-like.
.bc-avatar--groupedUsed to superimpose a smaller, ‘child’ avatar to the top right of the main one.
.bc-avatar--accent-borderAdds a colored border to the avatar.

Accessibility

Last modified:

When avatars represent a thing it’s important to include ‘alt text’.

For example:

  • alt="Person’s name" if the avatar represents a user
  • alt="Org name" if the avatar represents an organization.

If the avatar is purely presentational and carries no semantic value, use role='presentation'.

Rationale

Last modified:

Avatars allow users to personalize their accounts.

Avatars can help visually clarify the user associated with an event from a larger set of other users and events.

See also

Last modified: