Avatar
An avatar is a visual representation of a user or entity.
Install
One package and one stylesheet. The stylesheet holds the tokens every component uses.
pnpm add @wolf-rayet/reactimport '@wolf-rayet/react/css/wolf-rayet.css';
import { Avatar } from '@wolf-rayet/react';Props
A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
| name * | string | None | The person, team or project. It is required, because it becomes the image description and, when there is no image, the initials. |
| src | string | None | The image. Without one the avatar falls back to initials taken from the name. |
| size | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'medium' | Match it to the density. Small in a table row, larger on a profile. |
| appearance | 'circle' | 'square' | 'circle' | Circle for a person, square for a team, a project or anything that is not a human being. |
| presence | 'online' | 'busy' | 'focus' | 'offline' | None | A status dot. Use it only when you know the status and it helps people. |
| isDisabled | boolean | None | Dims the avatar for an account that is deactivated. |
Accessibility
What the component does for you, and what it needs from you.
- The name is the image description, so it is required.
- Presence is a coloured dot, so whatever it says has to be available in words nearby.
- An avatar is not a control. If it opens something, put it inside a button and give that button the name.