Components · Content
Avatar
A round avatar with the initials of name, which also names it for screen readers. size: sm to xl. tone tints it.
ExamplesLink to this section
Show JSONHide JSON
{
"version": 1,
"root": "box",
"elements": {
"box": {
"type": "Box",
"props": {
"direction": "horizontal",
"wrap": true,
"align": "center",
"gap": "md"
},
"children": ["small", "medium", "large", "extra"]
},
"small": { "type": "Avatar", "props": { "name": "Maya Chen", "size": "sm" } },
"medium": {
"type": "Avatar",
"props": { "name": "Omar Haddad", "tone": "info" }
},
"large": {
"type": "Avatar",
"props": { "name": "Priya Nair", "size": "lg", "tone": "success" }
},
"extra": {
"type": "Avatar",
"props": { "name": "Northwind", "size": "xl", "tone": "warning" }
}
}
}Maya Chen
Operations lead
Show JSONHide JSON
{
"version": 1,
"root": "row",
"elements": {
"row": {
"type": "Box",
"props": { "direction": "horizontal", "align": "center", "gap": "sm" },
"children": ["face", "who"]
},
"face": { "type": "Avatar", "props": { "name": "Maya Chen" } },
"who": {
"type": "Box",
"props": { "gap": "none" },
"children": ["name", "role"]
},
"name": {
"type": "Text",
"props": { "text": "Maya Chen", "weight": "medium", "size": "sm" }
},
"role": {
"type": "Text",
"props": { "text": "Operations lead", "tone": "muted", "size": "xs" }
}
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| namerequired | string | max 80 chars |
| size | "sm" | "md" | "lg" | "xl" | — |
| tone | "neutral" | "info" | "success" | "warning" | "danger" | — |
RulesLink to this section
- An avatar shows the initials of
nameand never loads a picture. - Screen readers announce
name.
Children and eventsLink to this section
Avatar is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
It emits no events.