Skip to content

Avatar

People, agents and tools: a photo, a logo or initials, with presence, a badge and a verified mark. Group them with +N, or pair one with a name.

On this page
Used for
  • Agent and teammate faces
  • Workspace logos
  • Run owners
  • Presence in a session
  • Reviewer stacks

Examples

Installation

npx knowns-ui@latest add avatar
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

label
string
Name for initials and the accessible name. Status and verified are appended ("Noor Haddad, online").
src
string
Photo. Fades in over the fallback; if it fails to load, falls back to icon, then initials, then a person glyph.
icon
ReactNode
Logo or glyph shown instead of initials.
size
"xs" | "sm" | "md" | "lg" | "xl" | "2xl"
Default"md"
20, 24, 32, 44, 56 or 72px, with matching type and corner radius.
shape
"square" | "circle"
Default"square"
Rounded square for agents and tools, circle for people.
hue
string
Tint for glyphs and initials, e.g. an agent colour.
status
"online" | "busy" | "away" | "offline"
Presence dot on the bottom-right (top-right when there is a badge).
badge
ReactNode
Small mark on the bottom-right, e.g. a company or model logo.
verified
boolean
Defaultfalse
Check mark on the corner when there is no badge.
ring
boolean
Defaultfalse
Ring in the surface colour; AvatarGroup sets it. Dot, badge and ring use --avatar-ring (default var(--background)).
decorative
boolean
Defaultfalse
Hide from assistive tech when the name is already next to it.
AvatarGroup.max
number
Show at most this many; the rest fold into "+N" with a tooltip listing them.
AvatarGroup.size / shape
AvatarSize / shape
Default"md" / "circle"
Applied to every avatar in the group.
AvatarGroup.label
string
Default"N people"
Accessible name of the group.
AvatarGroup.onAdd
() => void
Shows a dashed + button at the end; addLabel (default "Add people") names it.
AvatarGroup.stack
"end" | "start"
Default"end"
Which end sits on top. "start" puts the first avatar on top, so the first person (an owner, the assignee) reads in full.
AvatarGroup.decorative
boolean
Defaultfalse
Pure decoration, e.g. faces beside a count: hidden from assistive tech, no group name, no hover lift, no +N and no add button.
AvatarLabel.description
ReactNode
Supporting line under the name. AvatarLabel takes size sm | md | lg plus every Avatar prop.

What it handles

  1. 01Falls back from the photo in `src` to an `icon`, then to initials taken from `label` ("Noor Haddad" gives "NH"), and `initials` overrides the letters.
  2. 02Draws a presence dot from `status` (online, offline, busy, away) and puts it in the accessible name, as in "Noor Haddad, online".
  3. 03Adds a corner `badge` for a model or company mark, which moves the status dot to the top, or a `verified` check that is announced as "verified".
  4. 04Comes in six sizes from `xs` to `2xl` and two shapes, square or circle, with a `hue` prop to tint glyphs and initials per agent.
  5. 05Stacks avatars in AvatarGroup with a separating ring, folds the overflow into a "+N" chip that lists the hidden names, and never folds a single item.
  6. 06Offers an add button on AvatarGroup through `onAdd` and `addLabel`, and a `decorative` flag that hides the avatar when the name is already beside it.

States

First render
Nothing. It paints as it is
none
Photo loads
The initials fade out as the photo fades in, so no letters show through
280ms, ease out
Photo fails
The photo is dropped and the icon or initials stay
none
Group hover
The hovered avatar lifts by 2px above its neighbours
180ms, ease out
Reduced motion
The fade and the lift land at once
0ms

Works with

When to use

When to use

  • People, agents and organisations as an image, logo or initials, with status and groups.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Avatar to my app and wire it to my own data.
  • I need people, agents and organisations as an image, logo or initials, with status and groups. Set that up with the Knowns UI Avatar.
  • Which Avatar props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "avatar" }) and search_docs({ query: "avatar" }).

Need help?

Stuck on Avatar, or found something off? We read every message.