Search documentation

Search the documentation and open a page.

An image element with a fallback for representing the user.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/avatar

Composition

AvatarGroup (optional) ├── Avatar │ ├── AvatarImage (optional) │ ├── AvatarFallback │ └── AvatarBadge (optional) └── AvatarGroupCount (optional)

Examples

Badge

Loading...

Default

Loading...
Loading...

Group Count

Loading...

Group

Loading...

Profile

Loading...

Sizes

Loading...

Variants

Loading...

With Tooltip

Loading...

API Reference

Avatar

PropTypeDefaultDescription
size"default" | "sm" | "lg" | "xs" | "xl""default"Sets the avatar size.
shape"round" | "square""round"Sets the avatar shape.
idstring | undefinedgeneratedUnique identifier used to connect the avatar parts.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
onStatusChange((details: StatusChangeDetails) => void) | undefined—Runs when the image loading status changes to loaded or error.

Context, Hooks, and Types

ExportAPI
AvatarContextRender-prop component that exposes component state and actions.
AvatarRootProviderProvides an externally created API to the component tree.
useAvatarCreates or accesses the component API.
useAvatarContextReturns the nearest component API.