Avatar
A person’s image with a readable initials fallback.
Interactive preview
Usage
import { Avatar } from "@devvy-ui/react";
<Avatar name="Ada Rivera" />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | required | Accessible person name and initials source. |
| src / imageProps | string / native img props | — | Optional image and native image callbacks. |
| size / shape | sm | md | lg / circle | square | md / circle | Dimensions and shape. |
Accessibility & behavior
Platform Behavior & Guidelines
The outer span is the named image. Its image/initials are decorative inside it. A failed source falls back without hiding the name; a changed source can load again. Use meaningful names and native className/style customization.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add avatarMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.