Avatars

Avatar primitives for profile photos, groups, duos, and labeled identity patterns across the product.

Installation

npx chilli@latest add avatar

Avatar

User
User
User
User
User
User
User
User
User
User

Avatar Group

AB
CD
+1

Avatar Duo

Avatar Label

UsernameSupporting text
UsernameSupporting text
UsernameSupporting text
UsernameSupporting text
L
UsernameSupporting text
L
UsernameSupporting text
L
UsernameSupporting text
L
UsernameSupporting text
Username only
A
No subtitle

API Reference

Avatar

PropTypeDefaultDescription
srcstringThe image source URL.
altstringAlternative text for the image.
fallbackstring"?"Text displayed when no image is available.
size"xxsm" | "xsm" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl""md"The size of the avatar.
classNamestringAdditional CSS classes.

AvatarGroup

PropTypeDefaultDescription
avatarsArray<{ src?: string; fallback?: string; alt?: string }>[]List of avatars to display.
size"xxsm" | "xsm" | "sm" | "md" | "lg" | "xl" | "2xl""md"The size shared by all avatars in the group.
maxnumberall avatarsMaximum number of visible avatars before showing an overflow count.
spacingnumberautoOptional custom overlap between avatars.
showAddButtonbooleanfalseDisplays the trailing circular add button shown in the Figma design.

AvatarDuo

PropTypeDefaultDescription
primarySrcstringImage source for the front avatar.
primaryFallbackstring"?"Fallback text for the front avatar.
secondarySrcstringImage source for the back avatar.
secondaryFallbackstring"?"Fallback text for the back avatar.
size"xxsm" | "xsm" | "sm" | "md" | "lg" | "xl""md"The size preset of the duo container.

AvatarLabel

PropTypeDefaultDescription
srcstringThe image source URL.
fallbackstring"?"Fallback text displayed inside the avatar.
namestringPrimary label shown next to the avatar.
supportingTextstringOptional secondary text shown below the name.
size"sm" | "md" | "lg" | "xl""md"The size of the avatar label layout.