MO
ID

Code

<!-- halo-avatar.free.js: download it from the Install section below and host it with your site -->
<script src="/halo-avatar.free.js" defer></script>

<!-- one person -->
<halo-avatar name="Mira Okafor" src="/people/mira.jpg" status="online" size="72" theme="light"></halo-avatar>

<!-- a stack: the children are the people -->
<halo-avatar max="4" interactive theme="light">
  <img alt="Mira Okafor" src="/people/mira.jpg" data-status="online">
  <img alt="Jonas Weber" src="/people/jonas.jpg" data-status="speaking">
  <span data-name="Ines Duarte" data-status="away"></span>
  <span data-name="Tomas Lind"></span>
  <span data-name="Aiko Mori"></span>
</halo-avatar>

<script>
  document.querySelector('halo-avatar[interactive]').addEventListener('select', (e) => {
    console.log(e.detail.name, e.detail.index);
  });
</script>

In context

MO
Online
JW
Speaking
ID
Busy
TL
Away
AM
Offline
Every presence state
+2
Mint squircles, initials only Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/halo-avatar.json
2. Load it and use the element
HTML
<!-- halo-avatar.free.js: download it from the Install section below and host it with your site -->
<script src="/halo-avatar.free.js" defer></script>

<!-- one person -->
<halo-avatar name="Mira Okafor" src="/people/mira.jpg" status="online" size="48" theme="light"></halo-avatar>

<!-- a stack: the children are the people -->
<halo-avatar max="4" interactive theme="light">
  <img alt="Mira Okafor" src="/people/mira.jpg" data-status="online">
  <img alt="Jonas Weber" src="/people/jonas.jpg" data-status="speaking">
  <span data-name="Ines Duarte" data-status="away"></span>
  <span data-name="Tomas Lind"></span>
  <span data-name="Aiko Mori"></span>
</halo-avatar>

<script>
  document.querySelector('halo-avatar[interactive]').addEventListener('select', (e) => {
    console.log(e.detail.name, e.detail.index);
  });
</script>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// halo-avatar.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'halo-avatar': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      name?: string;
      src?: string;
      status?: 'online' | 'busy' | 'away' | 'offline' | 'speaking';
      size?: number | string;
      shape?: 'circle' | 'squircle';
      max?: number | string;
      overlap?: number | string;
      interactive?: boolean | '';
      active?: number | string;
      label?: string;
      theme?: 'light' | 'dark';
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React components — HaloAvatar and HaloAvatarStack — with TypeScript types and the full source
  • Sunset, Mint and Mono tints, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
name string''The person. Read out by screen readers with the status, and the source of the initials and their wash colour.
src URL—The photo. It lazy-loads over the initials and, if it fails, the initials simply stay.
status 'online' | 'busy' | 'away' | 'offline' | 'speaking'—The ring: flowing light when online, coral when busy, dim amber when away, none when offline, waves travelling outward while speaking. Leave it out for a plain avatar.
size number (px)48 (44 in a stack)Diameter; the ring, the bezel and the initials scale with it.
shape 'circle' | 'squircle''circle'Round, or a soft square for teams, workspaces and apps.
<img> / <span data-name> children—A stack: each child is a person — <img alt="Name" src data-status> or <span data-name="Name" data-status>. From script: el.people = [{ name, src, status }].
max numberallAvatars shown before the rest collapse into a "+N" pearl bead (the hidden names become its tooltip).
overlap number (0..0.6)0.28How far neighbours overlap, as a share of the size.
interactive booleanoffMakes every avatar a button: Tab and the arrow keys move along the stack, Enter fires select with detail.name and detail.index.
active number—Keeps one avatar of the stack raised with its label showing — for tours and "who is talking".
label string'N people'Accessible name of the stack.
theme 'light' | 'dark''light'White porcelain or dark.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Colours of the online and speaking ring, or a custom tint. Busy and away keep their coral and amber. Free build ships Aurora only.

Presence is never colour alone: the status is part of each avatar’s accessible name (“Mira Okafor, online”). A stack is a group; without interactive its avatars are images, with it they are real buttons. The name label sits above the avatar and the ring glows past its box, so leave about 40px of room above a stack and do not put it in a parent with overflow: hidden. The initials’ wash is picked from the name, so the same person always gets the same colour — pastel in light, deep in dark. All CSS, no WebGL; the ring stops flowing under prefers-reduced-motion.

More components