Person Label

View as Markdown

Who someone is, in one row: an avatar, a name and a quieter line that cuts off rather than wraps.

RequesterMarisol Kowalczyk-Hernández[email protected] · Enterprise
AgentTriage botTagged it Billing 4m ago

When to use

Who someone is, in one row: an avatar, a name and a quieter line that cuts off rather than wraps. Use Avatar instead when there's room for only the face.

Usage

import { PersonLabel } from "./ui/uicontext/components/PersonLabel.ts"
export const Owner = <M>(h: Html.H<M>) => PersonLabel(h, { person: { id: "ada", name: "Ada Okafor" }, meta: "Head of Product" })

Examples

Sizes

lg heads a profile, sm fits a table cell and cuts off rather than wraps.

Lena Fischer, awayVP Sales · Berlin
RepOpen pipeline
Priya RamanMid-market · London$412,000
Tomás GarcíaEnterprise · Madrid$1,280,500
Wei ChenSMB · Singapore$96,300

API reference

Options

PersonLabel options
NameTypeDescription
personrequired{ /** A stable id: it picks the avatar's color. */ readonly id: string readonly name: string readonly image?: string readonly presence?: typeof AvatarPresence.Type readonly agent?: boolean }—
metastringThe quieter line under the name: a role, an email, when they last replied.
size"sm" | "md" | "lg"sm for lists and table cells, md (the default) for panels, lg for a profile header.
hrefstringMakes the whole row a link to the person.
keystringNames this avatar among others in the same view; needed for more than one with a picture.
styleStyle—

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/person-label

Source