☀️ Summer Sale: up to 40% off all templates for a limited time.Get the deal
Shadcnadmin.com

Search

Search dashboards, components and blocks

Shadcn Avatar Components

An image element with a fallback for representing the user. Built with Shadcn UI, Tailwind CSS, Next.js and React, compatible with both Radix UI and Base UI primitives. Typescript included.

Avatar 1

No image

Icon

Status badge

Icon badge

Number badge

Avatar group

Avatar 8

Text and avatar group

Colorful

Rounded

With tooltip + avatar group

With tooltip

With dropdown menu

With popover

Absolute icon

Loading

Ring status

Avatar 19

Avatar 20

With dropdown menu

Shadcn Avatar: React Avatar Component with Image and Fallback

The Shadcn Avatar is a React avatar component for displaying user profile images with an automatic text fallback. It is styled with Tailwind CSS, fully typed with TypeScript and works on top of both Radix UI and Base UI primitives.

This page collects ready-made avatar examples you can copy straight into a React or Next.js project: circular and rounded avatars, multiple sizes, avatars with status indicators, stacked avatar groups and avatars paired with user details. Every variant ships as a single file with no extra configuration.

What is the Shadcn Avatar component?

An avatar represents a user or entity with a small image, and the Shadcn Avatar handles the hard part: when the image is missing, slow or broken, it renders a fallback with the user's initials instead of an empty circle. The swap happens automatically, so user lists never flash broken images.

Avatars show up in almost every interface: navigation bars, comment threads, chat messages, team pages, activity feeds and data tables in admin dashboards. Because the component is a thin wrapper over accessible primitives, it stays lightweight even when a page renders hundreds of avatars.

Why use the Shadcn Avatar?

  • Automatic fallback: Initials render while the profile image loads and whenever it fails, so the layout never breaks.
  • Every common pattern included: Sizes, shapes, status dots, notification badges and stacked avatar groups are ready to copy.
  • Tailwind CSS styling: Change size, ring, radius or colors with utility classes; no custom CSS files needed.
  • Accessible by default: Images keep their alt text and fallbacks are plain text, so screen readers always have something to announce.
  • TypeScript included: Every example is fully typed and works in React 19 and Next.js App Router projects.

Production tips

  • Always set alt text: Use the person's name as the image alt so assistive technology reads something meaningful.
  • Derive initials from the name: Generate the fallback from the display name at render time instead of storing initials separately.
  • Serve small images: A 40px avatar does not need a 1000px photo; request a resized thumbnail to keep lists fast.
  • Keep sizes consistent: Pick two or three avatar sizes for the whole app and reuse them so interfaces look intentional.
  • Cap avatar groups: In stacked groups, show the first few members and collapse the rest into a +N counter.

Integration with other components

The avatar rarely stands alone. Pair it with the Shadcn Hover Card to preview a user profile on hover, or place it inside a Shadcn Dropdown Menu trigger to build the account menu found in most application headers.

In data-heavy screens, avatars sit inside Shadcn Data Table rows and Shadcn Card layouts to make user records scannable, while a Shadcn Badge next to the avatar communicates roles or status. All of these patterns appear across the admin dashboard templates built with this design system.

Base UI and Radix UI support

The examples on this page follow the markup of the official shadcn/ui Avatar, which builds on the Radix UI Avatar primitive for image loading states and fallback timing.

The same component API also maps cleanly to the Base UI Avatar, so teams migrating between primitive libraries can keep the exact same Tailwind CSS classes and swap only the import.

FAQs

How does the avatar fallback work?
The component tracks the image loading state. Until the image has loaded, and whenever loading fails, it renders the fallback element, which is usually the user's initials on a muted background. No JavaScript configuration is required.
Can I build an avatar group with overlapping avatars?
Yes. Wrap several avatars in a flex container with negative horizontal margins and add a ring in the background color so each avatar stays readable. The avatar group examples on this page show the exact classes.
How do I add a status indicator to an avatar?
Position a small dot absolutely over the avatar's corner: green for online, gray for offline or a number badge for notifications. The status examples above include copy-paste code for both patterns.
Does the Shadcn Avatar support Base UI and Radix UI?
Yes. The default implementation uses the Radix UI Avatar primitive, and the same structure works with the Base UI Avatar component, so you can use whichever primitive library your project standardizes on.
How do I change the avatar size and shape?
Add Tailwind CSS utility classes to the Avatar element: size-8 or size-12 for dimensions, rounded-full for a circle or rounded-md for a rounded square. The fallback scales with the container automatically.