Skip to contentWolf-Rayet

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/react
import '@wolf-rayet/react/css/wolf-rayet.css';
import { Avatar } from '@wolf-rayet/react';

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
name *stringNoneThe person, team or project. It is required, because it becomes the image description and, when there is no image, the initials.
srcstringNoneThe 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'NoneA status dot. Use it only when you know the status and it helps people.
isDisabledbooleanNoneDims 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.