HQReact UI
DocsThemes
  • Getting Started
  • Introduction
  • Installation
  • Client Side Routing
  • MCP Server
  • LLMs
  • Framework Guides
  • Nextjs
  • Laravel
  • Vite
  • Tanstack Start
  • Components
  • Buttons
  • Button
  • File Trigger
  • Toggle
  • Charts
  • Chart
  • Collections
  • Accordion
  • Bubble
  • Collapsible
  • Context Menu
  • Dropdown Menu
  • Grid List
  • Item
  • List Box
  • Message
  • Table
  • Tag Group
  • Tree
  • Colors
  • Color
  • Controls
  • Command
  • Kbd
  • Slider
  • Switch
  • Toolbar
  • Date And Time
  • Calendar
  • Range Calendar
  • Date Field
  • Date Picker
  • Date Range Picker
  • Time Field
  • Drag And Drop
  • Drop Zone
  • Forms
  • Field
  • Input
  • Combobox
  • Input Group
  • Checkbox
  • Radio
  • Select
  • Text Field
  • Number Field
  • Search Field
  • Input OTP
  • Layouts
  • Container
  • Navbar
  • Sidebar
  • Media
  • Avatar
  • Carousel
  • Navigation
  • Link
  • Breadcrumbs
  • Tabs
  • Pagination
  • Overlays
  • Dialog
  • Alert Dialog
  • Sheet
  • Popover
  • Tooltip
  • Statuses
  • Alert
  • Badge
  • Empty
  • Meter
  • Progress
  • Skeleton
  • Toastalpha
  • Surfaces
  • Card
  • Separator

On this page

Avatar

Installation

CLI
Manual

npx shadcn add https://hq-ui.vercel.app/r/avatar

Examples

Basic

A basic avatar component with an image and a fallback.

avatar-basic
@shadcn
CN

Badge

Use the AvatarBadge component to add a badge to the avatar. The badge is positioned at the bottom right of the avatar.

avatar-badge
@shadcn
CN

Use the className prop to add custom styles to the badge such as custom colors, sizes, etc.

<Avatar src="https://github.com/shadcn.png" alt="@shadcn" fallback="CN">
  <AvatarBadge className="bg-green-600 dark:bg-green-800" />
</Avatar>

Badge with Icon

You can also use an icon inside <AvatarBadge>.

avatar-badge-icon
@pranathip
PP

Avatar Group

Use the AvatarGroup component to add a group of avatars.

avatar-group
@shadcn
CN
@maxleiter
LR
@evilrabbit
ER

Avatar Group Count

Use <AvatarGroupCount> to add a count to the group.

avatar-group-count
@shadcn
CN
@maxleiter
LR
@evilrabbit
ER
+3

Avatar Group with Icon

You can also use an icon inside <AvatarGroupCount>.

avatar-group-count-icon
@shadcn
CN
@maxleiter
LR
@evilrabbit
ER

Sizes

Use the size prop to change the size of the avatar.

avatar-size
@shadcn
CN
@shadcn
CN
@shadcn
CN

Dropdown

You can use the Avatar component as a trigger for a dropdown menu.

avatar-dropdown

API Reference

Avatar

The Avatar component is the root component that wraps the avatar image and fallback.

PropTypeDefault
size"default" | "sm" | "lg""default"
classNamestring-
srcstring-
altstring-
classNamestring-
fallbackstring<IconUser/>
Sidebar
Carousel

On this page

  • Installation
  • Examples
  • Basic
  • Badge
  • Badge with Icon
  • Avatar Group
  • Avatar Group Count
  • Avatar Group with Icon
  • Sizes
  • Dropdown
  • API Reference
  • Avatar