Avatar
Identity primitive for profile photos, initials, and fallback placeholders.
Best for
Import
import { Avatar } from "@enadhq/enad-react-sdk/client/ui-resolver"When to use it
Use Avatar anywhere a person, reviewer, or account needs a compact visual identity. It fits naturally in account menus, testimonial cards, review summaries, and team or author lists.
The component is intentionally simple. Most of the final look comes from the surrounding layout, the chosen size, and the fallback content.
Slot strategy
Avataris the outer frame.AvatarImagerenders the real image when one is available.AvatarFallbackgives you initials, a short label, or an icon when the image is missing.
Always provide a fallback. It keeps the UI stable and still communicates identity when the image does not load.
Behavior and theming guidance
Set size on the root with layout classes like size-8 or size-10 instead of rewriting the internal structure. Keep fallback text short so it stays legible at small sizes.
For accessible use, give the image a meaningful alt when it adds identity. If the nearby text already names the person, keep the alt brief and avoid repeating long labels.
Examples
Live examples you can edit directly in the sandbox.
Image with fallback
Pair the image and fallback every time so the component stays meaningful while assets load or fail.
Size from layout context
Control the avatar footprint from the wrapper class so it fits cleanly in lists, headers, and account menus.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | No description yet. |