Avatar
Basic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { Avatar } from "@corew500/ui/avatar"
<Avatar>Content</Avatar>Variants
avatarVariants
| Axis | Values | Default |
|---|---|---|
| size | xssmdefaultlgxl2xl | default |
avatarFallbackVariants
| Axis | Values | Default |
|---|---|---|
| intent | defaultprimarysecondaryaccentmuteddestructive | default |
CMS Integration
Loading...
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | enum | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
| style | enum | — | Style applied to the element, or a function that returns a style object based on the component’s state. |
| render | enum | — | Allows 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. |
| size | enum | — | — |
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