Skip to contentEnma

Components

Avatar

Live demo

How to use it

A person's photo or initials.

  • Provide name (used for initials and the accessible name), optionally src and size (sm 28, md 36, lg 48).
  • Fallback uses --e-accent-soft with --e-accent-ink.

Don't: decorate avatars with rings or status dots unless they carry meaning.

In every theme

Follows the mode picked in the header.
Graphite
Glass
Paper
Mineral
Enamel
Ember

Code

React
import { Avatar } from 'enma/react';

<Avatar name="Manish Mandal" />
<Avatar name="Priya Shah" src="/people/priya.webp" size="lg" />
Plain HTML
<span class="e-avatar e-avatar--md" role="img" aria-label="Manish Mandal"><span aria-hidden="true">MM</span></span>

Props

AvatarProps

Props of AvatarProps
PropTypeDefaultDescription
name requiredstring
srcstring
size'sm' | 'md' | 'lg''md'
classNamestring
styleReact.CSSProperties

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Open the command palette
Ctrl then K
Search
/
Show keyboard shortcuts
?
Close the top overlay
Esc
Go to Home
G then H
Go to Themes
G then T
Go to Playground
G then P
Go to Components
G then C
Go to Guides
G then G
Go to Samples
G then S