Avatar
Deterministic initials on a name-derived tint, in five sizes, with an optional indicator.
Live preview
Source
The exact file rendered in the preview above.
components/demos/avatar.tsx
components/ui/avatar.tsx
lib/format.ts
Demo source — adapt to your project. Foundry is not published as a package.
Usage
Foundry ships no photography, so avatars render initials. The tint is derived from the name’s character codes, which keeps the same person the same colour everywhere without a colour field in the data.
- Set `decorative` when the name is already visible next to the avatar, so it is not announced twice.
- Square avatars read as organisations and projects; circles read as people.
- Initials handle single-word names and very long names without overflowing.
Variants and states
Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.
- Five sizes
- Circle and square
- With presence indicator
- Decorative
Accessibility
- Naming
- A standalone avatar is `role="img"` with the name as its label; a decorative one is hidden entirely.
- Indicators
- A presence dot needs adjacent text — colour alone does not convey status.
Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.
Related
All componentsAvatar group
Overlapping avatars with an overflow count and a single accessible name for the whole set.
starter3 variantsActivity item
A compact feed row: actor, action, target, time and optional metadata.
starter3 variantsTable
A semantic table with two responsive strategies, a focusable scroll region and a built-in empty state.
intermediateFeatured5 variants