--- import { people, personById } from '@shared/lib/people' import DefaultLayout from '@shared/layouts/DefaultLayout.astro' import Avatar from '@ui/Avatar.astro' import AvatarUpload from '@ui/AvatarUpload.astro' import AvatarList from '@ui/AvatarList.astro' import Card from '@ui/Card.astro' import CardBody from '@ui/CardBody.astro' import CardTitle from '@ui/CardTitle.astro' import CardSubtitle from '@ui/CardSubtitle.astro' import { site } from '@shared/lib/site' import { firstLetters } from '@shared/lib/string-format' import DocsLink from '@ui/DocsLink.astro' const iconIcons = ['user', 'settings', 'car', 'balloon', 'users', 'users-group', 'apps', 'ghost'] const colors = site.themeColors const people8 = people.slice(0, 8) const people5 = people.slice(0, 5) const sizes = ['xxs', 'xs', 'sm', 'md', 'lg', 'xl'] as const const listSizes = ['xxs', 'xs', 'sm', 'md', 'lg'] as const const uploadSizes = ['xxs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'] as const const statusColors = ['red', 'green', 'blue', 'yellow', 'secondary'] const brands = ['netflix', 'amazon', 'messenger', 'figma', 'twitch'] ---
Default avatar The base .avatar element — a placeholder box for a photo, icon, or initials.
Avatar with icon Put an icon inside the avatar instead of a photo.
{iconIcons.map((icon) => )}
Avatar icon colors Combine an icon avatar with any theme color.
{colors.map((color) => )}
Simple avatar Show a photo by setting it as the background-image of the avatar.
{people8.map((person) => )}
Avatar placeholder Fall back to initials as the avatar text when there's no photo.
{people8.map((person) => )}
Avatar shapes Square by default — add .rounded-circle or .rounded-0 to change the shape.
Avatar sizes Six sizes from avatar-xxs to avatar-xl, for both photos and placeholders.
{sizes.map((size) => )}
{sizes.map((size) => )}
Avatar lists Stack avatars inside an .avatar-list container to show a group at a glance.
{ listSizes.map((size) => ( <>
{people5.map((person) => ( ))}
{people5.map((person) => ( ))}
)) }
Avatar upload An upload control styled as an avatar, for profile photo pickers. {uploadSizes.map((size) => )}
Avatar statuses Add a badge inside the avatar for an online, away, or busy status dot. {statusColors.map((color, i) => )}
Avatar brands Add a recognizable brand icon on top of an avatar. {brands.map((brand, i) => )}