PersonCell
The mock's .person: avatar, bold name, a muted line. Identity rule (CreatorIdentityMask): the handle and its link show only for a creator this store invited; a masked handle (la***) is never drawn, so a masked cell holds no "@" at all. BRICKS additions (optional): photo uses identity.avatarUrl when avatarSrc is not given (same as avatarSrc={identity.avatarUrl}), tier adds the v3 tier chip under the name.
import { PersonCell } from '@ergasti/bricks';Examples
Creator cell
A picture (initials if it is missing or fails), the name, the handle, a tier chip and a muted sub line. onOpen makes the name a button, still drawn bold (700) as the mocks draw every name.
Code
import { CreatorCell } from '@ergasti/bricks';
import { creators } from './sample-data';
function Creators() {
const [laila, karim, salma, , , , , , , , mona, omar] = creators;
return (
<div style={{ display: 'grid', gap: 14 }}>
<CreatorCell id={laila.id} name={laila.name} identity={laila.identity} tier="established" sub="201 orders" onOpen={() => {}} />
<CreatorCell id={salma.id} name={salma.name} identity={salma.identity} />
<CreatorCell id={mona.id} name={mona.name} identity={mona.identity} tier="rising" />
<CreatorCell id={omar.id} name={omar.name} identity={{ ...omar.identity, avatarUrl: 'data:image/png;base64,AAAA' }} tier="elite" />
<CreatorCell id={karim.id} name={null} identity={{ ...karim.identity, handle: null }} />
</div>
);
}Person cell
The plain name-and-handle cell; its avatarSrc and photo props are deprecated in favour of CreatorCell.
Code
import { PersonCell } from '@ergasti/bricks';
import { creators } from './sample-data';
function Person() {
const [laila] = creators;
return <PersonCell id={laila.id} name={laila.name} identity={laila.identity} sub="201 orders" />;
}Person cell options
onOpen makes the name a button, tier adds the tier chip, and photo with avatarSrc shows a picture (pass it only where the identity rules allow one).
Code
import { PersonCell } from '@ergasti/bricks';
import { creators } from './sample-data';
function PersonOptions() {
const c = creators[1];
return (
<div style={{ display: 'grid', gap: 12 }}>
<PersonCell id={c.id} name={c.name} identity={c.identity} tier={c.tier} photo avatarSrc={c.identity.avatarUrl ?? undefined} sub={`${c.orders} orders`} onOpen={() => {}} />
<PersonCell id={c.id} name={null} identity={{ ...c.identity, handle: null }} sub="Name hidden until they join" />
</div>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key personCell, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
creator | Creator | صانع محتوى |
Design guidance
How the BRICKS design system uses PersonCell. Written in docs/content/components/PersonCell.md; the props above are read from the code, which wins where the two disagree.
The 0.1.x person cell (avatar initials, name, a linked @handle, optional tier and second line); kept for existing screens, while new code uses CreatorCell.
It is the mock's .person: avatar, bold name, muted lines. It follows the same identity rule as CreatorCell: the handle, and its Instagram link, show only for a creator this brand invited. Unlike CreatorCell it draws initials unless you opt into a photo, and it stacks the handle, tier and sub on separate lines.
Anatomy
- Row:
span.kit-person, flex, 10px gap. - Avatar: initials on a seeded tone; a photo only with
avatarSrcorphoto. - Name:
<b dir="auto">, or a.kit-lnkbutton withonOpen; one line, ellipsis (wraps on phones). - Handle line:
.kit-person-sub, 12px--ink-3,dir="ltr";@handleas a link (new tab) whenidentity.links.instagramis a safe URL. - Tier line (when
tieris passed):TierChipin.kit-psub. - Sub line:
.kit-person-subwithsub.
Variants
| Setup | Look | When to use |
|---|---|---|
| Default | Initials, name, handle link | Existing 0.1.x tables. |
photo | identity.avatarUrl as the avatar | Deprecated; use CreatorCell. |
tier | Tier chip line | Where the tier is not its own column. |
States
| State | Trigger |
|---|---|
| Handle linked | invited, and links.instagram passes safeHref. |
| Handle plain | invited, no safe link. |
| Masked | not invited: no handle. |
| No name | name={null}: "Creator" / "صانع محتوى". |
| Broken photo | a failing avatarSrc falls back to initials. |
| Link hover | the handle underlines. |
Usage
<PersonCell id={1} name="Laila Saeed" sub="201 orders"
identity={{ handle: 'laila.saeed', invitedByYou: true, links: { instagram: 'https://instagram.com/laila.saeed', tiktok: null }, avatarUrl: null }} />// PR Portal › Brand detail › PR owner card
<Card title="PR owner" actions={<Button size="sm" onClick={openChangeOwner}>Change owner</Button>}>
<PersonCell id={owner.id} name={owner.name} identity={owner.identity} sub={owner.email} />
</Card>// Migrating: same data, v3 look
<CreatorCell id={c.id} name={c.name} identity={c.identity} tier={c.tier} sub="201 orders" />Where it appears
- In the v3 mocks: PR Portal › Brand detail › PR owner card (PR inventory).
- Library only: the Change owner modal; the kit gallery and older 0.1.x screens. The v3 brand tables use
CreatorCell.
Guidelines
Do
- Migrate to
CreatorCellwhen you touch a screen. - Pass the API identity unchanged.
Don't
- Don't use
avatarSrcorphotoin new code. - Don't use
onOpeninside a clickable row.
RTL and Arabic
- Mirrors with the flex row. Name
dir="auto", handle linedir="ltr".
Tokens
--ink-3, --rasp-d (handle link), --focus-ring, --min-touch-target.
Accessibility
- The handle link opens in a new tab with
rel="noreferrer noopener"; its text is the handle. - Avatar is decorative; name, handle and sub carry the meaning.
- On touch tiers (≤1024px) the name button and handle link get a 44px hit area; on desktop they are the text's size.
Found in the source
- No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
CreatorCell: the v3 replacement (photo by default, one muted line).Avatar,TierChip.
See also: BulkBar · CopyLink · DataTable
Source
src/kit/patterns/PersonCell.tsx (line 21) on GitHub.