Avatar
When to use it
Section titled “When to use it”- To show the signed-in user’s profile photo, such as in the header.
- To represent a person (a host, guest or reviewer) next to their name or content.
- Use md (30px) in the header, sm (24px) in dense lists or inline with text, and lg (40px) where the person is the focus, such as a profile or message thread.
When not to use it
Section titled “When not to use it”- For brand or company logos: use the Logo component instead.
Instead: Logo - For listing or content photos: use the Image component instead.
Instead: Image - As a clickable control on its own: place it inside a Button or Link so it has an accessible name.
Instead: Button or Link
Best practice
Section titled “Best practice”From the Figma documentation page (usage node 113:7), as written. These items aren’t carried into Avatar.intent.json, which has no field for them.
- Crop photos square with the face centred; the circle clips the corners.
- Keep one avatar size within the same list or row.
- Give the image alt text with the person’s name, or leave it empty when the name is shown right beside it.
- Use only the sm, md and lg sizes; don’t scale an avatar to other sizes.
- Always supply a photo. There’s no fallback for a missing photo yet.
What each variant is for
Section titled “What each variant is for”| Property | Value | What it is for |
|---|---|---|
size |
sm |
dense lists, inline with text |
size |
md |
the header avatar |
size |
lg |
profiles, message threads |
Accessibility
Section titled “Accessibility”- The photo is a native <img> whose alt text comes from the alt prop, defaulting to an empty string (decorative).
src/components/Avatar/Avatar.tsx:21
What this version promises
Section titled “What this version promises”From Versioning (VERSIONING.md at b9ffb76):
0.3.0 adds six components on top of 0.2.1: Calendar, Card, Form, Modal, SideBar and Table. It contains twenty-three components, each exported from the package root with its props type: Avatar, Breadcrumbs, Button, ButtonGroup, Calendar, Card, Checkbox, Chip, Dropdown, File, Form, Header, Image, Link, Logo, Modal, ProgressBar, RadioCard, SearchBar, SideBar, Stepper, Table, Toggle. Textfield is exported from the package root as well, with TextfieldProps and TextfieldState, and is public like the others (see decisions.md, 2026-10-07, Textfield). It commits you to their props, prop values and defaults, their hz- class names, the tokens in tokens.css and the three entry points (., ./styles.css, ./tokens.css). Everything in 0.3.0 beyond 0.2.1 is an addition: nothing from 0.2.1 was changed, removed or renamed. A change that breaks any of these on 0.x bumps the version to 0.4.0.
Two things about this release are worth knowing:
- Form, Modal and Table each passed release review with their literal sizes covered by a ruling in decisions.md (Card, SideBar and Calendar have their own), because no size tokens exist for them. Those literals are accepted until the designer adds matching tokens, so a later change to use tokens at the same rendered sizes would be a patch, not a breaking change.
- Dark theme is not verified for Table, and its warning tag has low contrast. The Table docs page says so. Neither is a breaking-change risk, but a fix that changes a token’s value is a patch and is listed in the changelog.
Stories
Section titled “Stories”All Sizes
Section titled “All Sizes”The single-variant stories (Sm, Md, Lg) are rows of the variant matrix; the Design tab links each one.
Import
Section titled “Import”import { Avatar } from "@layerbasesystemic/horizon-design-system";import type { AvatarProps, AvatarSize } from "@layerbasesystemic/horizon-design-system";@layerbasesystemic/horizon-design-system/tokens.css and @layerbasesystemic/horizon-design-system/styles.css must be loaded too; see Developing.
| Prop | Type | Default | Description |
|---|---|---|---|
size |
AvatarSize |
"sm" |
— |
src |
string |
— | — |
alt |
string |
"" |
— |
AvatarProps also extends Omit<HTMLAttributes<HTMLSpanElement>, "children">, so native attributes pass through to the element (Avatar.tsx:12).
Union types
Section titled “Union types”AvatarSize: sm, md, lg
Tokens it needs
Section titled “Tokens it needs”Every CSS custom property Avatar.css reads, with its value in the token build at b9ffb76.
| Token | Light | Dark |
|---|---|---|
--radius-full |
999px |
same as light |
This matches required_tokens in Avatar.intent.json exactly.
Figma node
Section titled “Figma node”Documentation frame ❖ avatar (113:2), component avatar (112:9); the page it sits on wasn’t identified in the Figma read. The file is shared with the team only, so the frame and the link ask anyone outside it to sign in.
Variant matrix
Section titled “Variant matrix”size (3) = 3 cells. The documentation frame lays the three sizes out in one row, sm 24x24, md 30x30 and lg 40x40, each labelled.
size |
Figma node | Story |
|---|---|---|
sm |
112:7 |
Sm |
md |
112:6 |
Md |
lg |
112:8 |
Lg |
Themes
Section titled “Themes”The Avatar frame renders every size once, on the dark overlay background (–color-bg-overlay). It has no separate light and dark frames.
The token build defines 179 tokens for light and redeclares 50 for dark; the Code tab shows Avatar’s tokens in both.
Values Figma never bound
Section titled “Values Figma never bound”Values on the Figma node that aren’t bound to a variable, and what Avatar.css at b9ffb76 does with each.
| Layer | Property | Figma value | In the code |
|---|---|---|---|
| size=sm (112:7) | width and height | 24px |
width: 24px; |
| size=md (112:6) | width and height | 30px |
width: 30px; |
| size=lg (112:8) | width and height | 40px |
width: 40px; |
Figma variables against the token build
Section titled “Figma variables against the token build”| Figma variable | Figma value | Token in the build | Built light value | Agrees |
|---|---|---|---|---|
--radius-full |
999 |
--radius-full |
999px |
yes |
Design gaps recorded against it
Section titled “Design gaps recorded against it”- 2026-10-01 · Avatar diameters with no token (decisions.md). These literals in src/components/Avatar/Avatar.css are accepted, because they’re what the Figma node specifies (node 113:2, component 112:9), until the designer adds avatar size tokens. Accepted values:
24px(width, height on .hz-avatar–sm, lines 13, 14);30px(width, height on .hz-avatar–md, lines 18, 19);40px(width, height on .hz-avatar–lg, lines 23, 24). Not ruled: Any other literal value, including a var() fallback. These values in any other component. A change to these values: a different number needs a new ruling or a token. The missing photo fallback and the empty use_when / dont_use_when in Avatar.intent.json: those are Figma gaps for the designer.