tailwind css simple avatar examples

In this tutorial we will see simple avatar, rounded avatar, border rounded avatar , status indicator avatar , status  avatar with icon, examples with Tailwind CSS.


Tool Use

Tailwind CSS 2.x / 3.x

Heroicons Icons

Unsplash for image


Setup Project

Using CDN

<link href="https://unpkg.com/[email protected]^2/dist/tailwind.min.css" rel="stylesheet">

Tailwind CSS 3 CDN

 <script src="https://cdn.tailwindcss.com"></script>


Example 1

Simple Avatar

<img class="object-cover w-16 h-16"
     src="https://images.unsplash.com/photo-1520315342629-6ea920342047?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MjR8fGNhdHxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
     alt="Avatar" />


tailwind avatar v1

tailwind avatar v1


Example 2

Simple Rounded Avatar

<img class="object-cover w-16 h-16 rounded-full"
    src="https://images.unsplash.com/photo-1520315342629-6ea920342047?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MjR8fGNhdHxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
    alt="Avatar" />


tailwind avatar v2

tailwind avatar v2


Example 3

Border Rounded Avatar

<img class="object-cover w-16 h-16 border-2 border-green-600 rounded-full"
     src="https://images.unsplash.com/photo-1520315342629-6ea920342047?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MjR8fGNhdHxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
     alt="Avatar" />
tailwind avatar v3

tailwind avatar v3


Example 4

Status Indicator Avatar

<div class="flex">
  <div class="relative">
    <img
      class="object-cover w-16 h-16 rounded-full"
      src="https://images.unsplash.com/photo-1520315342629-6ea920342047?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MjR8fGNhdHxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
      alt="Avatar"
    />
    <span
      class="absolute right-0 w-4 h-4 bg-green-600 border-2 border-white rounded-full  top-2"
    ></span>
  </div>
</div>
tailwind avatar v4

tailwind avatar v4


Example 5

Status  Avatar with Icon

<div class="flex">
  <div class="relative">
    <img
      class="object-cover w-16 h-16 rounded-full"
      src="https://images.unsplash.com/photo-1520315342629-6ea920342047?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MjR8fGNhdHxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
      alt="Avatar"
    />
    <span class="absolute right-0 bottom-1"
      ><svg
        xmlns="http://www.w3.org/2000/svg"
        class="w-6 h-6 text-blue-400"
        fill="none"
        viewBox="0 0 24 24"
        stroke="currentColor"
      >
        <path
          stroke-linecap="round"
          stroke-linejoin="round"
          stroke-width="2"
          d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
        /></svg
    ></span>
  </div>
</div>
tailwind avatar v5

tailwind avatar v5


Read Also

Tailwind CSS 3 FAQ Accordion UI Example

Tailwind CSS 3 Alert Message Example

Tailwind CSS 3 Avatars Example

Tailwind CSS 3 Badges Example

Tailwind CSS 3 Breadcrumb Example

Tailwind CSS v3 Button Examples

Tailwind CSS Gradient Button Example

Tailwind CSS 3D Button Example

Tailwind CSS Loading Button Example

Tailwind CSS v3 Cards Examples

Tailwind CSS Checkbox Form Examples

Tailwind CSS Dropdowns (Menu) on Hover Example

Tailwind CSS Multiselect Dropdown Example

How to use dark mode toggle switch in Tailwind CSS 3

How to use @apply directive in Tailwind CSS

Tailwind CSS sticky header & fixed navbar example

Tailwind CSS Navbar UI Example

Tailwind CSS 3 Login Page UI Example

Tailwind CSS Login Modal Example

Tailwind CSS Search Examples

Tailwind CSS 3 Overlay Image Example

Tailwind CSS Thank You Page Example

Tailwind CSS Timeline UI Example

Tailwind CSS Responsive Footer Section Example

Tailwind CSS Background Image Header Example