Pass an image and a fallback.
user-avatar.tsx
Avatar
<div>AvatarImage
<img>| Prop | Type | Default | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||
| plain | boolean | false | A plain <img> over the fallback, with no load state (only src, alt, and ref pass), for a virtual list that mounts avatars on each scroll frame. A failed photo shows the fallback. | |||||||
From Base UIAvatar.ImageBase UI docs | ||||||||||
| on | — | Callback fired when the loading status changes. | ||||||||
| keep | boolean | false | Whether the image element stays mounted and loads in place instead of being preloaded. Supports loading="lazy" and optimized image components such as next/image. | |||||||
| render | — | 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. | ||||||||
| ||||||||||
| ...props | <img> attributes | — | Every other attribute goes to the <img>, with a ref. | |||||||
AvatarFallback
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIAvatar.FallbackBase UI docs | |||
| delay | number | 0 | How long to wait before showing the fallback. Specified in milliseconds. |
| render | — | 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. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
AvatarBadge
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| status | "away""busy""default""offline""online" | — | |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
Built with
Installs with Avatar
- Components
- Dot



