React
Usage
Examples
Sizes
Use the size prop to change the size of the avatar.
React
Variants
Use the variant prop to change the variant of the avatar.
React
Shapes
Use the shape prop to change the shape of the avatar.
React
Fallback
If the image fails to load, the avatar will display the user’s initial. When no name is provided, a generic icon is shown instead.
React
Colors
Combine the colorPalette prop with some custom logic to dynamically change the color of the avatar.
React
Ring
Use the outline props to add a ring around the avatar.
React
Group
The Group component lets you display multiple avatars together. Use the stacking prop to control the order in which avatars overlap.
React
Badge
Show a badge on the right corner of the avatar by composing the Float and Circle components.
React
Persona
Here's an example of how to use the Avatar component to display a user persona.
Ryan Zou
ryan@zalify.com
React
Next.js
Here's an example of how to compose the avatar with Next.js Image.
Closed Component
Here's how to setup the avatar for a closed component composition.