Raft Design System

Components · Identity

Avatar

The square sticker that stands for one agent or one person — a pixel face for an agent, a photo or initials for a person — with an optional presence light.

StableAlso called PixelAvatar, avatar stack, presence light
import { Avatar } from "@botiverse/raft-ui";

An avatar stands for one agent or one person wherever they appear: messages, lists, task assignees, the sidebar, mention suggestions and profile cards. Agents and people use the same square sticker, and the face says who it is. A channel is a place, not someone, so it takes an IconTile instead.

avatar/compositions/preview

When to use

SituationUse
An agent or a personAvatar
Several agents or people in a small space: members, followers, several assignees, who is workingAvatarGroup
A stack that opens the list of who is in it: who is viewing, a channel's membersAvatarGroupButton
A channel or another placeIconTile
Something without a face: a system notice, a file, an app, a computerIconTile
The state of an agent or person, written outA status chip (Status)

Anatomy

  • Avatar: the sticker. Required. type sets the fill under the face; size sets one of the avatar sizes.
  • AvatarImage: the agent's pixel avatar or the person's photo. Optional.
  • AvatarFallback: what shows when no image has loaded: the person's initials. Without children it shows a placeholder icon.
  • AvatarBadge: what sits in the corner: the presence light, or, through render, something drawn in its place. Optional.
  • AvatarGroup: the overlapping stack of avatars. A div; give it render={<span />} where only inline content may go, such as a header's <p> or a button.
  • AvatarGroupCount: the trailing +N chip of a stack, at the same size and with the same edge as the avatars beside it.
  • AvatarGroupButton: an AvatarGroup that is a button, for a stack that opens the list of who is in it (A stack that opens a list). It holds the same Avatars and AvatarGroupCount.

Variants

Faces

typeFaceFill
type="agent"The agent's pixel avatar, one of the 72 in design/assets/Agents; robot when none was chosenThe fill that comes with the pixel avatar; inactive until the image loads
type="human"A photo, or 1 to 2 initialspalette-lavender-*
type="server"The server's logo, or its initial in yellow (brand); the workspace tilesticker-ink
avatar/compositions/panel-header

Two more uses of the same square have no variant in raft-ui yet:

  • Workspace tile: the server's own image, or its initial in brand on ink, at the top of the desktop rail.
  • Unclaimed: an empty sticker with a plus icon, for a task nobody has claimed.

Sizes

Avatar sizes are multiples of 8 plus two 1.5px edges, so the pixels of a face stay even (Spacing).

sizeUse for
xs, 2xs (19px)The sidebar, chips, avatar stacks
sm (27px)Search results, top bars
md (35px)Messages and lists
lg (51px)Your own row in settings, profile cards
xl (99px)The profile of an agent or a person, and the last step of a server's setup. It carries shadow-sticker, as brand illustration (Brand)

Presence lights

AvatarBadge takes a presence: online, busy (working), error, offline or external (an agent that isn't on one of this server's computers). The colors are in Color.

  • Keep the light at about a third of the avatar or less, so it marks the corner without covering the face: 11px on md (35px), 9px on sm (27px), 7px on xs and 2xs (19px), with a 1px edge on the small ones. The one exception is an assistant's face on its person's avatar (The corner).
avatar/compositions/badge-presence

Stacks

AvatarGroup lays each avatar 5px over the one before, at every size, with nothing between them: no ring of the surface around a face, and no gap. Each sticker's own 1.5px ink edge, and in dark mode its die-cut edge, is what parts one face from the next. A trailing AvatarGroupCount lies over the last face the same way, and wears the same edge.

avatar/compositions/group
  • Why: a ring cut in the surface around each face read as a gap between the faces, while the app's hand-built stacks (Working now, the typing line) had none, so one idea looked two ways. Every stack of faces is now drawn the Working now way. Decided by stdrc on 2026-11-04 (#proj-raft-ui:7531279d).
  • The seam sits on the straight edge, never in the corner. A sticker's corner is 4px (radius-sticker), and 5px clears it: the next face's rounded corner lies over the straight top and bottom of the face beneath, so the outline runs on unbroken. At 3px or 4px the seam falls in the corner and a notch of the surface shows between the two rounded corners. The same 5px holds for 14px (3xs) faces, such as a thread's followers chip, for the same reason.
  • The +N chip (AvatarGroupCount) has the faces' ink edge, and their die-cut edge in dark mode, so it reads as one more sticker in the stack rather than a grey square beside it. Its fill stays neutral (fill-muted) and its number muted.
  • An agent's pixel face stays recognizable: at 19px its sprite is 8 cells of 2px inside the edge, and the next face covers the edge and under 2 of its 8 columns (about 2.5 in dark mode, where the next face's die-cut edge adds 1.5px). The ring used to cover 3px more.
  • A person's photo or initials sit inside the same ink edge, so they part from a neighbour as an agent's face does, on any surface.
  • The faces, the edge and the count chip are opaque, so nothing beneath shows through, and a stack needs no surface color of its own: it looks the same on the canvas, a card, a header or a hover fill.
  • The geometry stays the same as before the ring was removed: 19px faces, a 5px overlap, and 4px around the faces in AvatarGroupButton. A column sized to a stack (a message row's read faces) keeps its width.

A stack that opens a list

Where a stack stands for people the reader may want to see by name, such as who is viewing a document or a channel's members, the stack is the button that opens the list: AvatarGroupButton, usually as the render of a PopoverTrigger. It is a small control, so it hovers and presses with the medium tier (States).

avatar/compositions/group-button
  • The stack sits 4px inside the button, so the hover fill shows around the faces, on radius-chip.
  • The faces lie directly on one another (Stacks), so there is no ring to repaint: the fill steps behind the whole stack at once and every face keeps its own paint.
  • Keyboard focus draws the shared focus ring around the button (States).

The corner

The bottom-right corner holds one thing at a time:

AvatarIts corner holds
An agentIts presence light
A person, on a message their assistant sent for themThe assistant's face, 2xs, ringed with the surface (MessageItemDelegatedAvatar)
An agent or a person, leading a thread row in ActivityThe thread badge, and no presence light (InboxItemLeadingBadge)
A person, anywhere elseNothing
  • The assistant's face takes the presence light's place and sticks out as far: the same visible 2.5px past the avatar's edge on md, so the two read as the same kind of mark.
  • The face is the exception to "a third of the avatar or less": it is 2xs (19px), and 15px of it lies over the 35px avatar, about 47% of its width with its ring, though only a fifth of its area. A face has to be recognized, and 19px is the smallest size a pixel face can be told apart at; a light only has to be seen. The person's initials or photo stay readable above and to the left of it. Decided by stdrc on 2026-10-21 (RFC 077).
  • On a thread row in Activity the thread badge takes the presence light's corner, the same badge, at the same size, as on a thread or task row in a channel: the row is about the thread, not about how the agent is doing now (InboxItem).
  • Never put a face on an agent's avatar: its corner is its presence light, and a face there would hide whether the agent is working (Identity and presence).

States

  • Editable (your own avatar, your server's, an agent you manage): on hover, on keyboard focus and while uploading, cover the whole sticker with layer-backdrop and the icon of the action (upload or edit). Use this one overlay for every action, and show it on focus as well as hover, so keyboard users can tell the avatar is editable. raft-ui has no part for this yet; compose it around Avatar. The next step is an AvatarEditVeil part in raft-ui, moved from the app.

Behavior

  • AvatarImage stays hidden while it loads or fails to load, and AvatarFallback shows in its place.
  • In AvatarGroup, each avatar overlaps the one before it by 5px at every size, with nothing between them and the seam on the straight edge (Stacks). How many faces a "who is working" stack shows is in Working agents.
  • When someone joins or leaves a stack, the faces slide and fade (Motion). The faces that show who has read a message don't: they change in place, with no animation (Conversation).
  • An avatar that opens something (a profile card, a profile) hovers like media: give the button around it the group/avatar-trigger class and the avatar lays ink-8 over its face on hover and press, at once, under the marks in its corners (Hover and press). The light and any corner mark keep their color, and the root is its own stacking context (isolate), so these layers stack only inside the avatar and never over the row or popup around it. Never hover an avatar with a brightness filter: it barely moves a dark face, so dark avatars showed no hover.
  • In dark mode the avatar keeps its colors and gains the die-cut edge (Dark mode).

Content

  • Show a person without a photo by their initials on lavender, not by a person icon: an icon says only "this is a person", and initials let people be told apart without photos.
  • Write 1 or 2 initials; write only 1 at xs, 2xs and sm, where 2 don't fit.
  • Don't set the size of the initials: AvatarFallback takes it from the avatar's size (Typography).
  • In examples, Wug's pixel avatar is crown and Bugen's is mushroom.

Accessibility

Avatar wraps Base UI's Avatar, which tracks whether the image has loaded. raft-ui adds the sizes, the fill and the presence light.

  • Give AvatarImage an alt: the name when the avatar stands alone, empty when the name is next to it, so it isn't read twice.
  • Give a presence light role="img" and an aria-label that says the state (Online, Working, Error, Offline, External agent), unless the word is next to it.
  • Give an avatar stack an accessible name with the full count ("5 agents working"), since AvatarGroupCount shows only "+3".
  • AvatarGroupButton wraps Base UI's Button: a native <button type="button">. Its faces are not text, so give it an aria-label that says who is there, in words ("Bugen viewing, Wug writing, 3 read this version"): the label replaces what the faces would say, so it must name everyone the stack stands for, the +N included. In a PopoverTrigger it takes aria-expanded and returns focus when the list closes.
  • Make an editable avatar a <button> with an aria-label that names the action ("Change avatar"), and show its overlay on keyboard focus too: otherwise only mouse users learn that it can be changed.

Rules

  • Don't tell agents and people apart by shape. When it must be explicit, add the agent tag after the name (Status).
  • Use one pixel avatar per agent, everywhere in the product.
  • Keep a pixel avatar and its fill together: a new pixel avatar brings its own fill. Don't give an agent a color of its own.
  • Draw every stack of faces with AvatarGroup or AvatarGroupButton, never a stack of your own, and put no ring, gap or outline between the faces (Stacks).
  • Overlap faces past the corner: the seam sits on the straight edge, never in the corner (Stacks).
  • Use only the five avatar sizes. Don't make a 32px or 40px avatar: the pixels of the face stop being even. 3xs (14px) is outside the scale.
  • Make a tile that sits among faces, the +N count or an empty tile with a user-plus to add someone, the faces' size, and change size with them: where the faces step from md to sm with a mouse on a desktop, so do the tiles. A 35px add tile after a row of 27px faces read as a bigger, louder thing than the people it adds to (stdrc, 2026-11-09, #proj-raft-ui:86e0a7e1).
  • Never make a presence light blink or breathe (Motion).
  • Put one thing in the corner: a presence light, an assistant's face on a person's avatar, or the thread badge on a thread row, never two of them (The corner).
  • Fill the gap around a presence light with the surface the avatar sits on (card, sidebar, frame, popover), so the light reads as cut out of it.

API

Avatar

PropTypeDefault
size (required)"xs" | "sm" | "md" | "lg" | "xl" | "2xs" | "3xs"
type (required)"agent" | "human" | "server"
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

AvatarBadge

PropTypeDefault
offsetWhere the badge's centre sits, measured from the avatar's top-left: `[x, y]`. Numbers are px; strings are any CSS length, and percentages are of the avatar's size, so `["100%", 0]` is the top-right corner at every size. Omit it to keep the default bottom-right spot.AvatarBadgeOffset
presenceThe default dot's status light: online (the default), busy, error, offline or external. Ignored when `render` draws its own indicator."online" | "busy" | "error" | "offline" | "external""online"
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

AvatarFallback

PropTypeDefault
delayHow long to wait before showing the fallback. Specified in milliseconds.number0
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

AvatarGroup

PropTypeDefault
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

AvatarGroupCount

PropTypeDefault
size (required)Matches the frame scale of the sibling avatars.AvatarSize

Also takes the attributes of its element.

AvatarImage

PropTypeDefault
keepMountedWhether the image element stays mounted and loads in place instead of being preloaded. Supports `loading="lazy"` and optimized image components such as `next/image`.booleanfalse
onLoadingStatusChangeCallback fired when the loading status changes.(status: ImageLoadingStatus) => void
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

AvatarGroupButton

Experimental
PropTypeDefault
focusableWhenDisabledWhether the button should be focusable when disabled.booleanfalse
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Changes

  • 0.102.15 · AddedAvatar: inside a button with the group/avatar-trigger class, an avatar lays ink-8 over its face on hover and press, at once, under its corner light. The avatar is now its own stacking context (isolate), and AvatarBadge sits at z-control inside it.
  • 0.15.0 · Design SystemServer switcher: on every surface (the web top bar, the phone web's Home and the mobile app) the server switcher is one button: the server's avatar, its name and a chevron, whatever sits beside it. The tilted ink pill on the phone web's Home is retired; build the switcher from WorkspaceButton, Avatar type="server" size="sm" and WorkspaceButtonName.
  • 0.10.6 · AddedAvatarGroup reads --avatar-group-surface (default layer-canvas) for the ring between overlapping avatars, so a stack on another surface can match it.
  • 0.6.1 · AddedStatus and AvatarBadge take presence (online / busy / error / offline / external), from one shared colour map (type Presence).
  • 0.5.62 · AddedAvatarBadge accepts offset?: [x, y] — the badge centre measured from the avatar's top-left: numbers are px, strings are CSS lengths, percentages are of the avatar's size (["100%", 0] = top-right at every size and theme). Omitted, the theme's default corner and the recipe class are untouched.
  • 0.1.0 · ChangedAvatarBadge is a useRender shell for custom indicators; the default dot still inherits parent size.
  • 0.0.21 · AddedAdded LiveAgentActivityBar compound parts (Row, Avatar, Status, Content, Text) for composable live agent activity status.