Fidely UI v1 beta is now available!. πŸš€

Avatar

A graphical representation of a user, commonly used in profile sections, comment threads, or user menus.

JC

Usage

import { Avatar } from '@fidely-ui/react'
<Avatar.Root>
  <Avatar.Fallback />
  <Avatar.Image />
</Avatar.Root>

Sizes

You can control the size of the Avatar using the size prop.

Fallback

When no image source is provided, the Avatar automatically renders the user’s initials and when no initial value it displays an icon.

JC

Props

Root

PropDefaultTypeDescription
colorPalettegray"red" | "blue" | "green" | "purple" | "orange" | "gray"The color palette of the component.
sizemd'full' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'The size of the component.
variantsubtle'solid' | 'subtle' | 'outline'The variant of the component.
shapefull'square' | 'rounded' | 'full'The shape of the component.
asβ€”React.ElementTypeThe underlying element to render.
asChildfalsebooleanUse the provided child element as the default rendered element, combining their props and behavior.
unstyledfalsebooleanWhether to remove the component's style.
idsβ€”Partial<{ root: string; image: string; fallback: string }>The ids of the elements in the avatar. Useful for composition.
onStatusChangeβ€”(details: StatusChangeDetails) => voidFunction called when the image loading status changes.
borderlessfalse'true' | 'false'Controls whether the avatar is rendered without a border.

Fallback

PropDefaultTypeDescription
nameβ€”string | undefinedThe name to derive the initials from. If not provided, displays a generic icon.
asβ€”React.ElementTypeThe underlying element to render.
asChildfalsebooleanUse the provided child element as the default rendered element, combining their props and behavior.

Image

PropDefaultTypeDescription
asβ€”React.ElementTypeThe underlying element to render.
asChildfalsebooleanUse the provided child element as the default rendered element, combining their props and behavior.