zalify-ui

Avatar

A component for displaying user profile images with fallback support.

CB

React

Usage

Examples

Sizes

Use the size prop to change the size of the avatar.

CB
CB
CB
CB
CB
CB

React

Variants

Use the variant prop to change the variant of the avatar.

CB
CB
CB
CB

React

Shapes

Use the shape prop to change the shape of the avatar.

CB
CB
CB

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.

CB

React

Colors

Combine the colorPalette prop with some custom logic to dynamically change the color of the avatar.

SN
BL
JL

React

Ring

Use the outline props to add a ring around the avatar.

CB

React

Group

The Group component lets you display multiple avatars together. Use the stacking prop to control the order in which avatars overlap.

CS
SA
PK
+3
CS
SA
PK
+3
CS
SA
PK
+3

React

Badge

Show a badge on the right corner of the avatar by composing the Float and Circle components.

CB

React

Persona

Here's an example of how to use the Avatar component to display a user persona.

RZ

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.

Props

Root

Fallback

Image