Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input OTP
- Input Group
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
- New Component
Elements
Charts
Icons
CNVCNS
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
export const AvatarDemo = () => (
<div className="flex items-center gap-4">
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage src="https://github.com/vercel.png" alt="@vercel" />
<AvatarFallback>VC</AvatarFallback>
</Avatar>
<Avatar><AvatarFallback>NS</AvatarFallback></Avatar>
</div>
);With Image
Display a user's profile picture. When the image fails to load, the fallback renders automatically.
CN
Fallback Only
When no image source is provided, or the image fails to load, the fallback displays initials or any content you pass.
NSABJD
Sizes
The default size is size-8 (32px). Override with Tailwind size utilities.
CNCNCNCN
Group
Stack avatars using negative margins to create a group effect.
CNVCNS+3
Props
Avatar
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS classes |
children | ReactNode | — | AvatarImage and AvatarFallback |
AvatarImage
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | — | Image source URL |
alt | string | — | Alt text for accessibility |
className | string | — | Additional CSS classes |
AvatarFallback
| Prop | Type | Default | Description |
|---|---|---|---|
delayMs | number | — | Delay before showing fallback (avoids flash) |
className | string | — | Additional CSS classes |
children | ReactNode | — | Initials or icon to display |
Usage
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
// With image + fallback
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
// Fallback only
<Avatar>
<AvatarFallback>NS</AvatarFallback>
</Avatar>
// Custom size
<Avatar className="size-12">
<AvatarImage src={user.avatarUrl} alt={user.name} />
<AvatarFallback>{user.initials}</AvatarFallback>
</Avatar>Specs
# Mint — Avatar Specs
## Component
- name: avatar
- file: registry/mint/avatar.tsx
- installs to: components/ui/avatar.tsx
- dependencies: radix-ui
## What is it
A circular image container for representing a user or entity. Falls back to
initials or any ReactNode when the image is unavailable or fails to load.
Use it in navigation bars, comment threads, user lists, and anywhere a
person's identity needs a visual anchor.
## Visual identity
Minimal. A rounded-full container — no border, no shadow — that keeps the
focus on the image or initials. The fallback uses bg-muted with centered
text in a small font-medium weight.
## Design tokens
--muted: oklch(0.96 0.02 155) — fallback background
--muted-foreground: oklch(0.52 0.06 155) — fallback text color
## Dark theme
--muted: oklch(0.2 0.03 155)
--muted-foreground: oklch(0.6 0.06 155)
## Anatomy
<Avatar> ← Root: rounded-full container, size-8 by default
<AvatarImage /> ← Radix image: aspect-square size-full
<AvatarFallback /> ← Shows when image missing/failed: flex centered, text-xs font-medium
</Avatar>
## States
- image loaded: AvatarImage fills the container, AvatarFallback hidden
- image failed / no src: AvatarFallback renders automatically
- delayMs: pass to AvatarFallback to avoid fallback flash during fast loads
## Conventions
- Always include AvatarFallback — even with a known src, network errors happen
- Use 1–2 character initials in the fallback (e.g. "NS", "AB")
- For grouped avatars: add border-2 border-background and -space-x-2 on the parent
- Do not use square avatars — keep rounded-full unless explicitly redesigning
- Default size is size-8 (32px); override with Tailwind size utilitiesInstallation
$ npx shadcn add \https://gin-design.vercel.app/avatar