Skip to content

Avatar Sizes and Shapes with Photos

Tailwind CSS avatar set with photos in six sizes, circle and rounded-square shapes, status dots, stacked groups and initials.

Also known as: user avatar set, profile picture sizes, avatar group stack, avatar with status indicator, initials avatar

Tailwind CSS Avatars Responsive #avatar #image #profile #responsive #status

Avatar Sizes and Shapes with Photos live demo

Open in new tab

Tailwind CSS code (HTML)

A complete avatar set built only with Tailwind CSS utilities: real profile photos in six sizes (24 to 112 px), in circle and rounded-square shapes, plus avatars with presence status, overlapping avatar groups with a counter, and initials fallbacks for users without a photo. Use it as a reference sheet for user lists, comment threads, team pages, chat apps and dashboards.

How it works

The root is section.av-set, a soft violet-to-sky gradient with a frosted white card inside. Every photo is an img.av-avatar with fixed width/height attributes and object-cover, so faces never stretch. The size scale uses Tailwind pairs h-6 w-6, h-8 w-8, h-10 w-10, h-14 w-14, h-20 w-20 and h-28 w-28, each labelled with its name and pixel size. The first row uses rounded-full; the second row grows the corner radius with the size, from rounded-md to rounded-3xl, so small and large squares look equally soft. A white ring-2 and shadow-md separate the photos from the background.

Status avatars wrap the image in a relative span and place a colored dot (bg-emerald-500, bg-amber-400, bg-rose-500, bg-slate-400) in the bottom-right corner with a ring-[3px] ring-white cut-out. The online dot adds an animate-ping halo. Groups are lists with negative spacing (-space-x-3) and white rings, followed by a +12 counter; the round group lifts each face on hover. The .av-initials badges use gradients or tinted backgrounds, and the last one shows an outline user icon for an unassigned slot. There is no CSS file and no JavaScript.

The sample photos come from Unsplash and are requested at twice the displayed size for sharp results on high-density screens; replace them with your own user images.

Customization

  • Change the h-* w-* pair on any img.av-avatar and update its width/height attributes to add a new size.
  • Replace rounded-full with rounded-xl (or the other way round) on an avatar to switch between circle and rounded-square shapes.
  • ring-2 ring-white: use ring-violet-400 for a highlighted or "selected" avatar.
  • Status colors: swap bg-emerald-500 or bg-rose-500 on the dot, and update the visible status text next to it.
  • -space-x-3 on the group list: use -space-x-1 for looser overlap or -space-x-5 for a tighter stack.
  • from-violet-500 to-fuchsia-500 on an .av-initials badge: pick any gradient for initials avatars.

Use cases

  • User lists and directories: six avatar sizes from 24 to 112 px for rows, cards and profile headers
  • Comment threads and chat apps: avatars with online, away and busy status dots show presence
  • Team pages: an overlapping group with a plus counter shows members on a project
  • Dashboards: initials badges act as a fallback for users without a photo
  • Design references: a ready sheet of circle and rounded-square shapes to copy single avatars from

Accessibility

Each photo has the person's name as alt text, and initials badges use role="img" with an aria-label holding the full name, so screen readers never read raw initials. Status dots are decorative (aria-hidden="true") because the status is also written as visible text. The +12 counter includes a visually hidden "more members" label, and groups are lists with an aria-label describing the group. The ping animation and hover lift are disabled with motion-reduce: utilities when the user prefers reduced motion.

Usage notes

Requires only the Tailwind browser build (added automatically). Copy a single avatar or a whole row; nothing depends on the surrounding markup.

Avatar Sizes and Shapes with Photos at a glance

Framework
Tailwind CSS
Code
HTML
JavaScript
Only Tailwind CSS's own script
Dependencies
Tailwind CSS
Layout
Responsive, works on mobile
Category
Avatars
License
Free for personal and commercial use

Questions about this template

Can I use the Avatar Sizes and Shapes with Photos code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Tailwind CSS from a CDN (the links are under Requirements). Paste the HTML where the component should appear. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. Only Tailwind CSS's own JavaScript is used, and the download already includes it.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Avatar Sizes and Shapes with Photos – Tailwind CSS avatars component screenshot
Avatar Sizes and Shapes with Photos · Tailwind CSS Avatars

More Avatars

Story Ring Avatars with Gradient Border – Pure CSS avatars preview

Story Ring Avatars with Gradient Border

Pure CSS story avatars with Instagram-style gradient rings, close friends and live variants, and a seen state that turns the ring grey on click.

Avatars with Status Indicator – Bootstrap 5 avatars preview

Avatars with Status Indicator

Bootstrap 5 avatars in five sizes with online, away, busy and offline status dots, initials fallback for missing photos and a status picker.

Avatar Group – Tailwind CSS avatars preview

Avatar Group

Overlapping Tailwind CSS avatar stack in three sizes with initials, status dots, name tooltips and a +N counter that reveals hidden people.