Skip to content

Data Display

Avatar

A user image with a graceful text fallback.

stableNo JS requiredhydrateless/avatar.css

A user image with a graceful text fallback. CSS-only.

Playground

Live
Ada AL

Avatar group

Overlap several avatars with a group wrapper.

Live
Grace Alan Edsger +3

Props

The framework bindings expose these props (and forward the rest to the root element).

PropTypeDefaultDescription
srcstringImage URL; falls back to children when missing.
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Diameter.
shape'circle' | 'square''circle'Avatar shape.

CSS variables

Override these on any ancestor to theme the component. See the theme studio to preview changes live.

CSS variableUsed for
--hl-surfaceFallback background.
--hl-radius-fullCircle radius.

Accessibility

  • Always give the <img> a meaningful alt, or empty alt="" when purely decorative.
  • Text fallbacks (initials) inherit the surrounding contrast tokens.

Released under the MIT License.