shadcn.io is not affiliated with official shadcn/ui
Avatar examples · Square
Avatar Square for React
A square avatar with a profile picture and initials as the fallback.
Round avatars are classic, but logos, apps and workspaces read better as squares. This React avatar passes rounded-lg to Avatar, AvatarImage and AvatarFallback, and after:rounded-lg to the avatar so its thin border follows the corners. Use it for company directories, workspace switchers, app lists, or anywhere brands sit next to people.
Preview
Installation
FAQ
How is the square shape applied?
The avatar styles start as a circle, so this file overrides them in four places: rounded-lg on Avatar, AvatarImage, and AvatarFallback, and after:rounded-lg on Avatar so the hairline border follows the corners.
Can I use a tighter or looser corner?
Swap rounded-lg for another radius utility and change all four spots together. Leave one on rounded-full and that piece stays round.
What do the image props do?
AvatarImage sets alt, plus width and height of 32, matching the default avatar size. AvatarFallback shows CN when that image is missing or fails.
Does size still apply to a square avatar?
Yes. size on Avatar is sm, default, or lg, and the radius classes don't change it. This file uses the default.
Related
- Avatar StandardA round avatar with a profile picture and
- Avatar with Placeholder Initials (Square)A square avatar with no picture that
- Avatar with Placeholder Icon (Square)A square avatar with no picture that
- Avatar with Online Indicator (Square)A square avatar with a green dot at the
- Avatar with Count Indicator (Square)A square avatar with a red count of
- Avatar with Offline Indicator (Square)A square avatar with a gray dot at the