- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Desktop Window
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Frame
- Heading
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Live Waveform
- Marker
- Menubar
- Message
- Message Scroller
- Meter
- Meter Ring
- Native Select
- Navigation Menu
- NumberCount
- Pagination
- Popover
- Progress
- Progress Ring
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Timeline
- Toast
- Toggle
- Toggle Group
- Tooltip
Need a notification count over an avatar?
NumberBadge self-anchors an animated
count in any corner.
import {
Avatar,
AvatarBadge,Installation#
bunx --bun shadcn@latest add @ondo-ui/avatar
Usage#
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"<Avatar>
<AvatarImage src="https://github.com/shadcn.png" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>Composition#
Use the following composition to build an Avatar:
Avatar
├── AvatarImage
├── AvatarFallback
└── AvatarBadgeUse the following composition to build an AvatarGroup:
AvatarGroup
├── Avatar
│ ├── AvatarImage
│ ├── AvatarFallback
│ └── AvatarBadge
├── Avatar
│ ├── AvatarImage
│ ├── AvatarFallback
│ └── AvatarBadge
└── AvatarGroupCountExamples#
Basic#
A basic avatar component with an image and a fallback.
import {
Avatar,
AvatarFallback,Badge#
Use the AvatarBadge component to add a badge to the avatar. The badge is positioned at the bottom right of the avatar.
import {
Avatar,
AvatarBadge as AvatarBadgeComponent,Use the className prop to add custom styles to the badge such as custom colors, sizes, etc.
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
<AvatarBadge className="bg-green-600 dark:bg-green-800" />
</Avatar>Badge with Icon#
You can also use an icon inside <AvatarBadge>.
import { IconPlus } from "@tabler/icons-react"
import {Avatar Group#
Use the AvatarGroup component to add a group of avatars.
import {
Avatar,
AvatarFallback,Avatar Group Count#
Use <AvatarGroupCount> to add a count to the group.
import {
Avatar,
AvatarFallback,Avatar Group with Icon#
You can also use an icon inside <AvatarGroupCount>.
import { IconPlus } from "@tabler/icons-react"
import {Sizes#
Use the size prop to change the size of the avatar.
import {
Avatar,
AvatarFallback,Dropdown#
You can use the Avatar component as a trigger for a dropdown menu.
"use client"
import {API reference#
The component wraps Base UI Avatar and accepts all of its props.