Avatar

A person's picture or initials on their own color, an agent's mark, and a presence dot, in five sizes.

Online
InitialsMPMPMPMPMP
Agent
Away
Offline

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/avatar

Usage

import { Avatar } from "./ui/uicontext/components/Avatar.ts"
export const Owner = <M>(h: Html.H<M>) =>	Avatar(h, { id: "ada", name: "Ada Lovelace", presence: "active", size: "md" })

API reference

AvatarGroupComponent

Props

AvatarGroup props
NameTypeDefaultDescription
peoplerequiredAvatarPerson[]—Who's in it, in the order they show.
labelrequiredstring—What the group is: "Reviewers", "In this doc". It names the group and heads the list.
maxnumber4How many tiles show, the "+N" counted as one; 4 by default.
sizeAvatarSize——
staticboolean—The "+N" only counts, with no list to open: for a crowded row where the list lives elsewhere.

AvatarView function

Options

Avatar options
NameTypeDefaultDescription
keystring—Names this avatar among others in the same view; needed for more than one with a picture.
size"xs" | "sm" | "md" | "lg" | "xl"sm20, 24, 32, 40 or 64px; sm by default.
decorativeboolean—Leave the avatar out of the accessibility tree, when its name is already written beside it.
styleStyle—StyleX styles applied after the avatar's own.

Source