GitHub

Avatar

Displays user profile images with fallback initials

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { Avatar } from "@corew500/ui/avatar"

<Avatar>Content</Avatar>

Variants

avatarVariants

AxisValuesDefault
size
xssmdefaultlgxl2xl
default

avatarFallbackVariants

AxisValuesDefault
intent
defaultprimarysecondaryaccentmuteddestructive
default

CMS Integration

CMSPayload CMS Integration
This component supports CMS-driven content via @corew500/cms-payload.
Loading...

API Reference

Props

PropTypeDefaultDescription
classNameenumCSS class applied to the element, or a function that returns a class based on the component’s state.
styleenumStyle applied to the element, or a function that returns a style object based on the component’s state.
renderenumAllows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
sizeenum

Accessibility

Screen Readers

  • - AvatarImage requires an `alt` attribute for screen readers
  • AvatarFallback content is announced when image fails to load

Additional

  • Use descriptive alt text: "Profile photo of John Doe" not just "avatar"

Localization

Translatable Content

  • - The `alt` prop on AvatarImage should contain translated text
  • AvatarFallback children (initials) should be localized if needed