ValyroUI Русская версия

Avatar

User avatars. Free, MIT · Basics › Labels and tooltips

Installation

npx valyro-cli@latest add avatar
npx shadcn@latest add https://valyro.xyz/r/avatar.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Avatar } from 'valyro-ui';

Props

PropTypeDefault
srcstringImage URL. When omitted or failing to load, initials (or fallback) are shown instead.
namestring''Used for alt text, initials and the fallback color.
size'xs' | 'sm' | 'md' | 'lg' | 'xl'Avatar dimensions, from 20px (xs) to 64px (xl). Inside an AvatarGroup, defaults to the group's size.
shape'circle' | 'square''circle'Circle, or a square with corners rounded to a quarter of the size.
status'online' | 'offline' | 'busy' | 'away'Presence dot in the corner; also appended to the accessible name.
statusLabelstringSpoken status text appended to the name, e.g. "en ligne". Defaults to the status value.
fallbackReactNodeCustom fallback (e.g. an icon) instead of initials.

Related components

Previous: Badge · Next: Tooltip · All Basics