Skip to content
Glint UI

Avatar

A face with a fallback for when there is no picture, a corner badge for presence, and a row for a group of them.

Usage

import { Avatar, AvatarBadge } from "@glint/components/avatar.slint";
import { Tokens } from "@glint/theme/tokens.slint";
export component AppWindow inherits Window {
width: 560px;
height: 200px;
background: Tokens.color-background;
VerticalLayout {
alignment: center;
padding: 24px;
Avatar {
size: 48px;
fallback: "JD";
alt: "Jane Doe";
AvatarBadge {
status: "Active";
}
}
}
}

Avatar renders a circular profile image with fallback initials. AvatarBadge mounts in the bottom-right corner to indicate presence or verification status. AvatarGroup stacks multiple avatars in an overlapping row.

Examples

Sizes

Adjust the size property to scale the avatar diameter and fallback typography.

Badges and status

Mount AvatarBadge in the avatar’s corner slot. Customize tint or supply a Lucide icon for verified or idle states.

Avatar group

Wrap multiple avatars in AvatarGroup to create an overlapping stack with optional overflow counter.

API Reference

Properties

PropertyTypeDefaultDescription
sourcein imageno defaultImage to display; when empty, fallback initials render instead.
fallbackin stringno default1–2 letter initials shown when source is empty.
sizein length40pxPixel diameter of the circular avatar.
altin stringno defaultWho this is a picture of. Empty leaves the avatar decorative.
ringin boolfalseDraws a ring in the surface colour around the circle — what separates one face from the next inside an AvatarGroup.
ring-colorin colorTokens.color-backgroundThe surface the ring pretends to be. Override it on a card or any other background the default does not match.
badge-sizein lengthroot.size * 0.32Side of the corner box @children are laid out in. A badge scales with the face it sits on, so this is the avatar's to decide: Slint gives a component no way to read the parent it was slotted into.

AvatarBadge

The marker in the corner of a face — a presence dot, or a glyph. It is ringed in the surface color so it reads against the photo under it, and status is what a screen reader hears.

Properties

PropertyTypeDefaultDescription
tintin colorTokens.color-affirmFill — the presence colour. Affirm reads as "here"; pass the destructive or muted token for the other states.
iconin LucideIconno defaultOptional glyph inside the dot, normally selected from IconSet.
icon-tintin colorTokens.color-primary-foregroundInk for that glyph.
ring-colorin colorTokens.color-backgroundThe surface the ring pretends to be.
statusin stringno defaultWhat the dot means. Colour alone does not reach assistive technology — leave it empty only for a badge that is genuinely decoration.

AvatarGroup

A row of overlapping faces. Each face wants ring: true, because only the avatar knows what surface it is standing on and a group cannot reach into the children it was handed.

Properties

PropertyTypeDefaultDescription
sizein length40pxDiameter of the faces in the row. The group only needs it to draw the overflow count at the same size.
overlapin lengthroot.size / 4How far each face is pulled onto the one before it.
overflowin int0How many more there are than the row shows. 0 draws no count.
ring-colorin colorTokens.color-backgroundThe surface the rings pretend to be — the overflow count wears the same one the faces beside it do, so a group on a card is not the one chip that gives the trick away.

Accessibility

  • Accessible image role. The avatar announces as accessible-role: image with alt supplying the accessible label.
  • Fallback suppression. When alt is populated, the visual fallback initials are suppressed from the accessibility tree (accessible-role: none) to prevent duplicate reading.
  • Status announcement. AvatarBadge publishes accessible-role: text with its status string, making visual dots legible to screen readers.