shadcn.io is not affiliated with official shadcn/ui
Avatar examples · Square
Avatar with Online Indicator (Square) for React
A square avatar with a green dot at the bottom corner showing it is online.
On a square avatar, a status dot usually says a system is up rather than a person is around. This React avatar uses rounded-lg on the avatar, its image and its fallback, and adds an AvatarBadge with bg-success at the bottom corner, with a visually hidden Online label. Use it for workspaces, integrations, bots or services that are connected and responding.
Preview
Installation
FAQ
How is this avatar squared off?
rounded-lg is on Avatar, AvatarImage, and AvatarFallback, and after:rounded-lg is on Avatar so the border follows. AvatarBadge is a circle of its own and doesn't take those classes.
How is the online dot made?
AvatarBadge uses bg-success. It sits on the bottom end corner with a ring in the background color, from the badge styles.
How is the dot labeled?
A visually hidden "Online" inside AvatarBadge is the accessible name. The green class is only the paint.
Does the dot follow the avatar size?
Yes. Leave size at the default, as this file does, or set sm or lg. The badge scales with that prop.
Related
- Avatar with Offline Indicator (Square)A square avatar with a gray dot at the
- Avatar with Online Indicator (Standard)A round avatar with a green dot at the
- Avatar SquareA square avatar with a profile picture
- Avatar with Count Indicator (Square)A square avatar with a red count of
- Avatar with Placeholder Icon (Square)A square avatar with no picture that
- Avatar with Placeholder Initials (Square)A square avatar with no picture that