In order to implement this component, you can follow the examples from Skewind below that use mixed classes from the avatar component and TailwindCSS to modify the styles or sizes.

Usage

You just need two elements, the wrapper element that holds the avatar class and the avatar object element that holds avatar__object class to be placed inside the wrapper.

Avatar Objects

Other than an img element, you can use any other object as well, such as:

Avatar Initial

Avatar Icon


                                                

Avatar Colors

There is a soft color option too. The avatar__object--soft class is the one.

With Badge


                                                

Customization Examples

We will use TailwindCSS utility classes to do the customization of the component.

Square Avatar

To make a square avatar, just add a rounded utility to the avatar object element.


                                        

Avatar Sizes

You can easily change the size of the avatar by using only the width w-{size} utility class.