shadcn.io is not affiliated with official shadcn/ui
Avatar examples · Standard
Avatar with Online Indicator (Standard) for React
A round avatar with a green dot at the bottom corner showing it is online.
You know the small green dot next to profile pictures in chat apps. This React avatar adds one with AvatarBadge, the avatar's own part for a status dot: it sits at the bottom corner with a ring in the background color, and bg-success makes it green. The dot carries a visually hidden Online label for screen readers. Use it in chat, team directories, or any tool where presence matters.
Preview
Installation
FAQ
How is the online dot made?
AvatarBadge is inside Avatar, with bg-success for the green. The component pins it to the bottom end corner and gives it a ring in the background color. This file adds no positioning classes.
How do screen readers get the status?
The badge has no icon. A visually hidden "Online" inside AvatarBadge is what gets read.
Does the dot scale with the avatar?
Yes. AvatarBadge takes its size from the avatar's size. This file uses the default. sm and lg resize the avatar and the dot together.
How do I use a different status color?
Change the class on AvatarBadge. This file uses bg-success. Change the hidden label in the same edit so the words match the color.
Related
- Avatar with Offline Indicator (Standard)A round avatar with a gray dot at the
- Avatar StandardA round avatar with a profile picture and
- Avatar with Count Indicator (Standard)A round avatar with a red count of unread
- Avatar with Online Indicator (Square)A square avatar with a green dot at the
- Avatar with Placeholder Icon (Standard)A round avatar with no picture that shows
- Avatar with Placeholder Initials (Standard)A round avatar with no picture that shows