tsimport {XDSAvatar} from '@xds/core/Avatar'
| Guidance | Practices |
|---|---|
| Do | Always pass a name so the avatar can show initials if the photo fails to load, and so screen readers can announce who it represents. |
| Do | Pick a size that matches the context — tiny or xsmall for inline mentions, small or medium for lists and cards, large for profile headers. |
| Do | Add a status dot when knowing someone's availability matters, like in chat or team views. |
| Don't | Use Avatar for logos, product images, or anything that isn't a person or team — use an image or icon instead. |
| Don't | Force a square or custom shape — avatars are always circular to stay consistent across the system. |
| Prop | Type | Description |
|---|---|---|
src | string | Primary image source URL. |
fallbackSrc | string | Fallback image when primary fails. |
name | string | User name for initials and alt text. |
alt | string | Alt text (falls back to name). |
size | XDSAvatarSize (default: 'small') | Avatar size (named or numeric pixel value). |
status | ReactNode | Corner content for status indicators. |
| Prop | Type | Description |
|---|---|---|
variant | 'positive' | 'neutral' | 'negative' (default: 'positive') | Semantic color variant of the dot. |
label | string | Accessible label for screen readers. |
icon | ReactNode | Icon centered inside the dot (hidden at tiny sizes). |