Components
Avatar
An image element with a fallback for representing the user.
Installation
Install ReUI
Refer to the Installation Guide for detailed instructions on setting up ReUI dependencies in your project.
Install dependencies
npm install @radix-ui/react-avatar
Add component
Copy and paste the following code into your project’s components/ui/avatar.tsx
file.
Examples
Default
Loading
Fallback
Loading
Indicator
Loading
Status
Loading
Badge
Loading
Size
Loading
Group
Loading
Users
Loading
API Reference
This component builds on the Radix UI Avatar primitives, adding customization options such as indicators and status.
Avatar
This component is based on the Avatar.Root primitive.
Prop | Type | Default |
---|---|---|
className |
AvatarImage
This component is based on the Avatar.Image primitive.
Prop | Type | Default |
---|---|---|
className |
AvatarFallback
This component is based on the Avatar.Fallback primitive.
Prop | Type | Default |
---|---|---|
className |
AvatarIndicator
This is a custom component used to display an indicator within the avatar.
Prop | Type | Default |
---|---|---|
className |
AvatarStatus
This is a custom component for displaying a status indicator on the avatar.
Prop | Type | Default |
---|---|---|
variant | online | |
className |