AvatarAn image element with a fallback for representing the user.
The Avatar component displays a user's profile picture with support for fallback content when the image fails to load. It can be customized with different sizes, variants, and colors.
Install the component from your command line.
The
Avatar comes with a range of predefined colors including both base and extended color options to match your design system.
Choose between soft and solid variants to control the visual weight and emphasis of the avatar in your interface.
Choose between small and full border radius styles to match your design preferences.
Avatar can display user images with graceful fallback to initials when images fail to load or aren't available.
S
S
F
F
J
J
npm install @raystack/apsara
import { Avatar, AvatarGroup } from '@raystack/apsara/v1' <Avatar alt="John Smith" src="/path/to/image.jpg" fallback="JS" size={5} />
Avatar
component accepts the following props:
size
: Specifies the size of the avatar (1-13, default: 3)src
: The URL of the image to displayalt
: Alternative text description for the imagefallback
: Content to display when image fails to load or while loadingvariant
: Visual style variant ("solid"
|"soft"
, default: "soft")radius
: Border radius style ("small"
|"full"
, default: "small")color
: Color theme for the avatar:- Base colors:
"indigo"
|"orange"
|"mint"
|"neutral"
- Extended colors:
"sky"
|"lime"
|"grass"
|"cyan"
|"iris"
|"purple"
|"pink"
|"crimson"
|"gold"
- Base colors:
asChild
: Boolean to merge props onto child elementclassName
: Additional CSS class names
AvatarGroup
component accepts the following props:
children
: Array of Avatar components to displaymax
: Maximum number of avatars to show before displaying a count (number)className
: Additional CSS class names
loading...
loading...
loading...
loading...
loading...