shadcn.io is not affiliated with official shadcn/ui
Avatar examples · Standard
Avatar with Offline Indicator (Standard) for React
A round avatar with a gray dot at the bottom corner showing it is offline.
Not everyone is online all the time, and showing who isn't matters as much as showing who is. This React avatar adds an AvatarBadge with bg-muted-foreground, a quiet gray dot at the bottom corner, with a visually hidden Offline label for screen readers. Use it in chat, team directories, or any list that mixes active and inactive people.
Preview
Installation
FAQ
How is the offline dot made?
AvatarBadge uses bg-muted-foreground, so the dot picks up the theme's muted foreground in light and dark. It sits on the bottom end corner with a ring in the background color.
How do screen readers get Offline?
The badge contains a visually hidden "Offline". There is no icon. The gray class is not announced.
How do I use this dot for a different status?
Swap bg-muted-foreground for another background token, and change the hidden text to match. This file's pair is the muted token plus "Offline".
Does the dot scale with the avatar?
Yes. AvatarBadge reads size on Avatar. This file leaves size at the default, so you get the default dot.
Related
- Avatar with Online Indicator (Standard)A round avatar with a green dot at the
- Avatar StandardA round avatar with a profile picture and
- Avatar with Offline Indicator (Square)A square avatar with a gray dot at the
- Avatar with Count Indicator (Standard)A round avatar with a red count of unread
- 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