Avatar
A person/entity photo, or initials from name; optional status ring.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A person/entity photo, or initials from name; optional status ring.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/avatar
import { Avatar } from '@/components/prism/Avatar';
In a no-build prototype, read it from the bundle instead: const { Avatar } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
name | string | — | Names the avatar for screen readers and drives the initials. |
src | string | null | — | Photo URL. Without one, the initials from name show. |
size | "sm" | "md" | "lg" | "xl" | "2xl" | — | sm 28px · md 40px · lg 56px · xl 64px · 2xl 80px. |
tone | "accent" | "neutral" | "inverse" | — | Initials colouring: the accent tint (default), grey, or inverse. |
hue | PrismHue | "auto" | — | A categorical hue for the initials tint, or "auto" to pick one from name. |
ring | boolean | "accent" | "positive" | "notice" | "negative" | "neutral" | — | A ring with a small gap around the avatar: true = accent, or a tone. Pair a status ring with text. |
isDecorative | boolean | — | Hide from screen readers — use when the person's name is already in the text next to it. |
className | string | — |