Avatar

Bring your users to life! Our Avatar gives your user a face, or an icon, or initials. You choose, we display

Example

1import { Avatar, Flex } from '@haktos/sugarcoat-ui';
2
3<Flex gap='3' justify='center'>
4 <Avatar
5 size='xs'
6 src='https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80'
7 />
8
9 <Avatar
10 size='sm'
11 src='https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80'
12 />
13
14 <Avatar
15 src='https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80'
16 />
17
18 <Avatar
19 size='lg'
20 src='https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80'
21 />
22
23 <Avatar
24 size='xl'
25 src='https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80'
26 />
27</Flex>
28

API Reference

It builds on top of Radix-UI Avatar

ComponentDescription
Avatar

Your digital persona. A visual representation, typically an image or an icon, that uniquely identifies a user or an entity in your UI.

AvatarGroup

The social circle. A component that clusters multiple Avatars together, perfect for displaying group or team members in your UI.

Component Properties

Avatar
PropTypeDefaultExplanation
sizestringmd

The size of the Avatar.

colorstringdefault

The color of the Avatar.

shapestringcircle

The shape of the Avatar.

shadowbooleantrue

Whether to display a shadow around the Avatar.

inactivebooleanfalse

Whether to display the Avatar as inactive.

srcstring-

Image source for the Avatar.

altstring-

Alternate text for the Avatar image.

AvatarGroup
PropTypeDefaultExplanation
limitnumber-

The maximum number of Avatars to display.

numbernumberThe number of Avatars that are not displayed.

The number that shows up when the number of Avatars exceeds the limit.

colorOfNumberstringdark

The color of the number displayed when the number of Avatars