Avatar Component
The Avatar component in the Arts Oven UI Component Library is designed to visually represent users or entities within your application. Avatars can display images, initials, or icons, making them versatile for various use cases.
Square Avatar
The size of avatars is highly customizable using Tailwind CSS utility classes for height
and width
or size
. You can easily adjust the dimensions of your avatars to fit your design requirements:
<!-- Avatar xs -->
<div class="avatar size-8">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar sm -->
<div class="avatar size-10">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar md -->
<div class="avatar size-12">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar lg -->
<div class="avatar size-16">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xl -->
<div class="avatar size-20">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xxl -->
<div class="avatar size-24">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xs -->
<div className="avatar size-8">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar sm -->
<div className="avatar size-10">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar md -->
<div className="avatar size-12">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar lg -->
<div className="avatar size-16">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xl -->
<div className="avatar size-20">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xxl -->
<div className="avatar size-24">
<img class="rounded-lg"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
Rounded Avatar
<!-- Avatar xs -->
<div class="avatar size-8">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar sm -->
<div class="avatar size-10">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar md -->
<div class="avatar size-12">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar lg -->
<div class="avatar size-16">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xl -->
<div class="avatar size-20">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xxl -->
<div class="avatar size-24">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xs -->
<div className="avatar size-8">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar sm -->
<div className="avatar size-10">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar md -->
<div className="avatar size-12">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar lg -->
<div className="avatar size-16">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xl -->
<div className="avatar size-20">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xxl -->
<div className="avatar size-24">
<img class="rounded-full"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
Squircle avatar
<!-- Avatar xs -->
<div class="avatar size-8">
<img class="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar sm -->
<div class="avatar size-10">
<img class="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar md -->
<div class="avatar size-12">
<img class="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar lg -->
<div class="avatar size-16">
<img class="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xl -->
<div class="avatar size-20">
<img class="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xxl -->
<div class="avatar size-24">
<img class="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xs -->
<div className="avatar size-8">
<img className="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar sm -->
<div className="avatar size-10">
<img className="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar md -->
<div className="avatar size-12">
<img className="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar lg -->
<div className="avatar size-16">
<img className="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xl -->
<div className="avatar size-20">
<img className="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
<!-- Avatar xxl -->
<div className="avatar size-24">
<img className="mask is-squircle"
src="https://images.unsplash.com/photo-1554966428-fff3d7016132?q=80&w=3832&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
alt="avatar"/>
</div>
Avatar Group
<div class="avatar-group -space-x-6">
<!-- Avatar-->
<div class="avatar size-16">
<img class="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div class="avatar size-16">
<img class="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div class="avatar size-16">
<img class="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div class="avatar size-16">
<img class="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div class="avatar size-16">
<img class="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div class="avatar size-16">
<img class="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
</div>
<div className="avatar-group -space-x-6">
<!-- Avatar-->
<div className="avatar size-16">
<img className="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div className="avatar size-16">
<img className="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div className="avatar size-16">
<img className="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div className="avatar size-16">
<img className="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div className="avatar size-16">
<img className="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
<!-- Avatar-->
<div className="avatar size-16">
<img className="rounded-full"
src="https://placehold.co/200x200"
alt="avatar"/>
</div>
</div>
Customizing with CSS Variables
You can customize the avatar size by using Tailwind CSS utility classes like w-
, h-
, and size-
. This allows you to easily adjust the dimensions of the avatar to meet your design needs without the need for additional styles.
<div class="avatar size-10">
<!-- Other elements -->
</div>
You can customize the appearance of the component using following CSS variables.
:root {
/* Avatar border width */
--avatar-border-width: 4px;
/* Avatar border color */
--avatar-border-color: #FFFFFF;
}
Refer to the Customization Guide to learn more about how to use these variables to customize the components.
Adding Shadows and Gradients
You can enhance your buttons with shadows and gradients by enabling these features in your tailwind.config
configuration:
artsovenui: {
shadow: true,
gradients: true,
},
Contribute ideas!
Share Your Ideas! While we can’t guarantee that every request will be added, we will definitely consider your suggestions for future updates.