Skip to content
Fleetline

Avatar

Usage

Use an avatar to help people recognize a mechanic, driver or dispatcher at a glance — in assignment lists, work-order headers and comments. Don't use avatars for vehicles or depots; use an icon. An avatar never replaces the name: show the name next to it, or in its accessible name when space is tight.

Status text: "Available", "Busy · on WO-4191", "Off shift until 06:00" — always written, the dot only repeats it.

Anatomy

  1. Container — .avatar, circle sized by --size-control-*
  2. Content — img.avatar__img, or .avatar__initials, or svg.avatar__icon
  3. Status dot (optional) — .avatar__status[data-status], with its own shape per status
  4. Label (optional) — .avatar-label with name and detail text

Examples

States marked hover and focus-visible are frozen with .is-hover and .is-focus-visible. Those classes share their rule with the real pseudo-class; never use them in product code.

Avatar

Fallback order: photo → initials → generic icon.

Marta Quintero
Marta QuinteroAvailable · bay 2 Lena BrandtBusy · on WO-4191 Sami HaddadOff shift until 06:00
<!-- Photo; alt is the person's name -->
<span class="avatar"><img class="avatar__img" src="marta.jpg" alt="Marta Quintero"></span>

<!-- Initials; tone picked from a hash of the person's id -->
<span class="avatar avatar--tone-teal" role="img" aria-label="Idris Okafor">
  <span class="avatar__initials" aria-hidden="true">IO</span>
</span>

<!-- Name printed beside it: alt="", status in words -->
<span class="avatar-label">
  <span class="avatar"><img class="avatar__img" src="marta.jpg" alt=""><span class="avatar__status" data-status="available"></span></span>
  <span class="avatar-label__text"><span class="avatar-label__name">Marta Quintero</span><span class="avatar-label__detail">Available · bay 2</span></span>
</span>

API

HookValuesPurpose
.avatarblock classCircle container
.avatar--sm | --lgmodifier class32 / 40 (default) / 48px
.avatar--tone-neutral | --tone-teal | --tone-bluemodifier classInitials colors; pick with id % 3
.avatar__img | __initials | __iconpart classesContent in fallback order
.avatar__status + data-status="available|busy|away|off"part + attributeStatus dot: filled / bar / ring / hollow
.avatar-label, __text | __name | __detailcompanion blockAvatar with name and status text

Do and don't

Avatar + "Marta Quintero · Available"

Do pair the avatar with the name and status in text.

Green dot only.

Don’t show availability with a colored dot alone.

alt="" when the name is printed right next to it

Do avoid announcing the name twice.

alt="avatar" or alt="profile picture"

Don’t describe the image type; name the person instead.

Accessibility

Avatars are not interactive. If an avatar opens a profile, wrap it in a link whose name is the person's name.

Tokens

Custom propertyPurpose
--size-control-sm | -md | -lgAvatar sizes
--color-bg-subtle / --color-text-defaultNeutral initials
--color-selected-bg | -fgTeal initials
--color-feedback-info-bg | -fg | -borderBlue initials
--color-feedback-success-icon | -danger-icon | -warning-iconStatus dot fills
--color-bg-surfaceRing that separates the dot from the photo
--radius-fullCircle shape