Skip to the page content

Avatars

Initials, icons and presence for people and businesses.

13 avatar types

Sizes

Six sizes, from 26px for dense tables to 96px for a profile header. The initials scale with the circle.

Basic
263240567296
Show code
<span class="basalt-avatar basalt-avatar-xs basalt-avatar-tone-1">ML</span>  <!-- 26px -->
<span class="basalt-avatar basalt-avatar-sm basalt-avatar-tone-1">ML</span>  <!-- 32px -->
<span class="basalt-avatar basalt-avatar-tone-1">ML</span>            <!-- 40px -->
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-tone-1">ML</span>  <!-- 56px -->
<span class="basalt-avatar basalt-avatar-xl basalt-avatar-tone-1">ML</span>  <!-- 72px -->
<span class="basalt-avatar basalt-avatar-xxl basalt-avatar-tone-1">ML</span> <!-- 96px -->

Tones

Eight tints taken from the chart colors, so they change with the palette. The letters are mixed toward the text color to stay readable on every tint.

Basic
MLtone-1TOtone-2CDtone-3KMtone-4AMtone-5CRtone-6FMtone-7BHtone-8
Show code
<!-- tone-1 to tone-8 follow the palette's chart colors -->
<span class="basalt-avatar basalt-avatar-tone-1">ML</span>
<span class="basalt-avatar basalt-avatar-tone-2">TO</span>
<span class="basalt-avatar basalt-avatar-tone-3">ID</span>

Shapes and icons

Circles for people, rounded squares for customer companies and suppliers, squares for products. An icon stands in when there are no initials, the dashed one marks an empty seat and the ring marks the one selected.

Basic
Circle Rounded Square Solid Empty seat Ring
Show code
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-tone-1">ML</span>                  <!-- people -->
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-rounded basalt-avatar-tone-6"><i class="bi bi-heart"></i></span>
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-square basalt-avatar-tone-4"><i class="bi bi-box-seam"></i></span>
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-solid">HS</span>
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-outline"><i class="bi bi-person-plus"></i></span>
<span class="basalt-avatar basalt-avatar-lg basalt-avatar-ring basalt-avatar-tone-2">TO</span>          <!-- selected -->

Presence dot

A dot in the corner for online, away, busy or offline, sized from the avatar. Away and busy also carry a small mark, so the state does not rest on color alone. Change your own status from the menu.

Indicator
Misty Leach

TOOnline CDAway KMBusy AMOffline
Show code
<span class="basalt-avatar-status">
  <span class="basalt-avatar basalt-avatar-lg basalt-avatar-tone-2" role="img" aria-label="Todd Nugent, online">TO</span>
  <span class="basalt-avatar-status-dot basalt-avatar-status-dot-online"></span>
</span>
<!-- --online, --away, --busy, or no modifier for offline.
     Away and busy carry a mark as well as a color. -->

Avatar with count

A small count in the upper corner, for unread messages or open tasks. The number is also in the avatar's label, so it is read out.

Indicator
ML TO CD
Show code
<span class="basalt-avatar-status">
  <span class="basalt-avatar basalt-avatar-lg basalt-avatar-tone-2" role="img"
        aria-label="Todd Nugent, 3 unread messages">TO</span>
  <span class="basalt-avatar-badge" aria-hidden="true">3</span>
</span>

Progress ring avatar

A ring round the avatar that fills to a value: how complete a profile is, or how far someone is through their training. Pure CSS, set with one variable.

Indicator
KM35% AM70% CRDone FMTraining 82%
Show code
<!-- --value is 0 to 100. --success and --warning change the color. -->
<span class="basalt-avatar-meter value-70"
      role="img" aria-label="Abby Morrow, profile 70% complete">
  <span class="basalt-avatar basalt-avatar-lg basalt-avatar-tone-5">AT</span>
</span>

Avatar stack

Overlapping avatars for a team or the people on a record, ending in a "+N". The overlap follows the size, and two modifiers add a lift or a spread on hover.

Group

Small

MLTOCDKM

Medium, lifts on hover

MLTOCDKM

Large, spreads on hover

MLTOCDKM
Show code
<div class="basalt-avatar-group" role="group" aria-label="4 people and 7 more">
  <span class="basalt-avatar basalt-avatar-tone-1" role="img" aria-label="Misty Leach">ML</span>
  <span class="basalt-avatar basalt-avatar-tone-2" role="img" aria-label="Todd Nugent">TO</span>
  <span class="basalt-avatar basalt-avatar-more" aria-hidden="true">+7</span>
</div>
<!-- avatar-group-sm / --lg change the overlap; --hover lifts,
     --spread fans the stack out -->

Avatar with name

An avatar with a name and a line of detail beside it. The chip version is for people picked in a form, with its own remove button.

Layout
Misty LeachTeam manager Lakeside ApparelPro plan, 14 seats

Picked for the roster

Todd NugentCarly DillonKirk Mathis

Show code
<span class="basalt-person">
  <span class="basalt-avatar basalt-avatar-tone-1" aria-hidden="true">ML</span>
  <span>
    <span class="basalt-person-name">Misty Leach</span>
    <span class="basalt-person-meta">Team manager</span>
  </span>
</span>

<span class="basalt-person-chip">
  <span class="basalt-avatar basalt-avatar-xs basalt-avatar-tone-2" aria-hidden="true">TO</span>Todd Nugent
  <button type="button" class="basalt-person-chip-remove" aria-label="Remove Todd Nugent">
    <i class="bi bi-x" aria-hidden="true"></i>
  </button>
</span>

Avatar list

People in a list with their presence, role and a quick action. The status is written out as well as shown by the dot.

Layout
  • Misty LeachTeam managerOnline
  • Todd NugentSchedulerOnline
  • Carly DillonCustomer careAway
  • Kirk MathisOn-site carerBusy
Show code
<ul class="basalt-people">
  <li>
    <span class="basalt-person">
      <span class="basalt-avatar-status">
        <span class="basalt-avatar basalt-avatar-tone-1" aria-hidden="true">ML</span>
        <span class="basalt-avatar-status-dot basalt-avatar-status-dot-online"></span>
      </span>
      <span>
        <span class="basalt-person-name">Misty Leach</span>
        <span class="basalt-person-meta">Team manager</span>
      </span>
    </span>
    <span class="basalt-people-role">Online</span>
    <a class="btn btn-sm btn-outline-secondary" href="chat.html" aria-label="Message Misty Leach">…</a>
  </li>
</ul>

Profile tile

A larger avatar leading a small card, for a team page or a people picker. Tiles wrap to fit the space they are given.

Layout
Abby MorrowAccount manager
Francis McCallTeam lead
Show code
<div class="basalt-profile-tile">
  <span class="basalt-avatar-status">
    <span class="basalt-avatar basalt-avatar-xl basalt-avatar-tone-5" aria-hidden="true">AT</span>
    <span class="basalt-avatar-status-dot basalt-avatar-status-dot-online"></span>
  </span>
  <span class="basalt-person-name">Abby Morrow</span>
  <span class="basalt-person-meta">Account manager</span>
  <div class="basalt-profile-tile-actions">
    <a class="btn btn-sm btn-outline-secondary" href="my-profile.html">Profile</a>
  </div>
</div>

Generated avatar

Give it a name and it works out the initials and picks one of the eight tones from the name, so a person keeps the same color everywhere without anyone storing it. Type a name to try it.

Interactive

Initials AT, tone 5

Show code
<!-- Initials and tone are worked out from the name, and the same
     name always gets the same tone on every page. -->
<span class="basalt-avatar" data-basalt-avatar data-name="Abby Morrow"
      role="img" aria-label="Abby Morrow"></span>

<script>
  // After changing data-name, redraw it:
  basaltAvatar(el);
</script>

Editable avatar

A camera button on the avatar opens the file picker, and an image dropped on the avatar works too. A ring fills while the picture loads, and Remove goes back to the initials.

Interactive
ML

Misty Leach

Pick a photo or drop one on the avatar. It stays in this tab.

Show code
<div data-basalt-avatar-edit>
  <div class="basalt-avatar-edit">
    <span class="basalt-avatar-edit-ring" aria-hidden="true"></span>
    <span class="basalt-avatar basalt-avatar-xxl basalt-avatar-tone-1" data-basalt-avatar-edit-target
          role="img" aria-label="Profile photo: none, showing initials">ML</span>
    <button type="button" class="basalt-avatar-edit-btn" aria-label="Change profile photo"
            data-basalt-avatar-edit-pick><i class="bi bi-camera" aria-hidden="true"></i></button>
    <input type="file" accept="image/*" class="visually-hidden" tabindex="-1"
           aria-hidden="true" data-basalt-avatar-edit-input>
  </div>
  <p aria-live="polite" data-basalt-avatar-edit-status></p>
  <button type="button" class="btn btn-sm btn-outline-secondary" data-basalt-avatar-edit-remove>Remove</button>
</div>

Avatar group with overflow

A stack that shows as many people as fit and folds the rest into a "+N" button. The button opens a list of everyone hidden, each avatar has a tooltip and links to the profile, and the stack fans out on hover or keyboard focus. Try the controls.

Interactive
5
Size
ML TO CD KM AM CR FM BH SD EK DW

5 shown, 6 more in the list

Show code
<div class="basalt-avatar-group basalt-avatar-group-spread" role="group" aria-label="Service team, 11 people"
     data-basalt-avatar-group data-max="5">
  <a href="my-profile.html" class="basalt-avatar basalt-avatar-tone-1" data-name="Misty Leach"
     data-meta="Team manager" aria-label="Misty Leach, Team manager"
     data-bs-toggle="tooltip" data-bs-title="Misty Leach">ML</a>
  <!-- one link per person -->
  <div class="dropdown">
    <button type="button" class="basalt-avatar basalt-avatar-more basalt-avatar-group-more"
            data-bs-toggle="dropdown" aria-expanded="false">+6</button>
    <ul class="dropdown-menu dropdown-menu-end basalt-avatar-roster"></ul>
  </div>
</div>
<!-- The script hides everyone past data-max, writes the "+N" and
     fills the list with the people it hid. -->