Skip to content
bitboss-ui3.0.0-beta.79

BbAvatar

Display a person or entity with an image, a named fallback, and predictable loading behaviour.

import { BbAvatar } from 'bitboss-ui';

On this page

Use it for

Use BbAvatar for a person's or entity's visual identity in member lists, activity feeds, and assignee cells. It is display-only.

Use something else when

  • BbIndicator, when status or a count belongs on the avatar
  • BbDropdown, when the avatar opens an account menu
  • BbIcon, when the mark represents no person or entity

Passthrough

Hover or tap a part to outline it. The toggles turn on loading, errors and warnings where the component has them; only parts get a row.

Marta Villoresi

Show a member

Pass the photo and the person's name. The name is the accessible name, and the initials when the photo is missing or fails.

Marta Villoresi
Marta VilloresiHead of Product

The fallback order is image, default slot, initials from name, then the built-in person icon. Ada King Lovelace shows AL. Write alt only when the photo needs a description of its own: it wins over name as the accessible name.

xssmmdlgxl2xl
PhotoMarta VilloresiMarta VilloresiMarta VilloresiMarta VilloresiMarta VilloresiMarta Villoresi
Initials (name)
No name
Failed photoIdris BelloIdris BelloIdris BelloIdris BelloIdris BelloIdris Bello

size accepts the shared xs–2xl scale, pixels, or a CSS length, and switches at breakpoints with a map: :size="{ default: 'sm', lg: 'xl' }". The image is always center-cropped into a circle; there is no square variant.

Tell people apart

Add color and each person gets a colour picked from their name. The same name gets the same colour on every page and in the server render.

  • Idris BelloFrontend Engineer
  • Rania HaddadSupport Manager
  • Tomas DelgadoPlatform Engineer
  • Nikhil RaghavanProduct Analyst
  • Elif YilmazDesign Systems Engineer

Without color the fallback paints with --bb-primary. The palette is the --bb-avatar-* theme tokens.

Presence and groups

Compose status and overflow around the avatar instead of turning the avatar into an interactive control.

  • Ingrid HalvorsenIngrid HalvorsenFinancial Analyst · Online
  • Chiara BonettiChiara BonettiContent Strategist · Away
  • Idris BelloFrontend Engineer · Online
  • Rania HaddadSupport Manager · Away
  • Engineering8 members
    Lukas BrandtAmara OkonkwoHugo Ferreira +4
  • Design4 members
    Sofia MarchettiYuki Tanaka
  • Product3 members
    Marta Villoresi

A presence dot is silent, so repeat the status in text. Wrap a clickable avatar in a real button, link, or dropdown trigger; BbAvatar emits no events.

Slow images and SSR

The component checks the image timeout milliseconds after mount (400 by default) to recover events missed before hydration. A late image can still replace the fallback.

vue
<BbAvatar :src="member.photo" :name="member.fullName" :timeout="4000" />

Raise it for a slow origin, so readers do not see the initials flip to the photo. Use srcset with sizes for responsive sources; both pass through to the underlying image.

The image loads lazily. Write loading="eager" on an avatar above the fold; fetchpriority, decoding, crossorigin and referrerpolicy reach the <img> the same way.

Bots and custom colour

For a bot or service account, place an unlabeled BbIcon in the fallback slot and keep the actor's name in name. For a colour that comes from data, such as a workspace's own, pass it to color: the initials turn black or white, whichever reads (in the dark scheme the colour becomes a wash with a light ink of the same hue). To pin the ink as well, set --fg on the avatar.

Release activity

  • Release bot deployed v2.14.0 to production2 minutes ago
  • Lukas BrandtLukas Brandt approved the release14 minutes ago
  • Lumen Outdoor workspace switched to the new build1 hour ago
Coming from v2color

color takes a CSS colour for the fallback, or true for a palette colour picked from name. For a product-wide look, retheme the primary pair instead.