Skip to Content
BBRICKSv0.7.4
KitLists and tables

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.

personCell
KeyEnglishArabic
creatorCreatorصانع محتوى

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

  1. Row: span.kit-person, flex, 10px gap.
  2. Avatar: initials on a seeded tone; a photo only with avatarSrc or photo.
  3. Name: <b dir="auto">, or a .kit-lnk button with onOpen; one line, ellipsis (wraps on phones).
  4. Handle line: .kit-person-sub, 12px --ink-3, dir="ltr"; @handle as a link (new tab) when identity.links.instagram is a safe URL.
  5. Tier line (when tier is passed): TierChip in .kit-psub.
  6. Sub line: .kit-person-sub with sub.

Variants

SetupLookWhen to use
DefaultInitials, name, handle linkExisting 0.1.x tables.
photoidentity.avatarUrl as the avatarDeprecated; use CreatorCell.
tierTier chip lineWhere the tier is not its own column.

States

StateTrigger
Handle linkedinvited, and links.instagram passes safeHref.
Handle plaininvited, no safe link.
Maskednot invited: no handle.
No namename={null}: "Creator" / "صانع محتوى".
Broken photoa failing avatarSrc falls back to initials.
Link hoverthe 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 CreatorCell when you touch a screen.
  • Pass the API identity unchanged.

Don't

  • Don't use avatarSrc or photo in new code.
  • Don't use onOpen inside a clickable row.

RTL and Arabic

  • Mirrors with the flex row. Name dir="auto", handle line dir="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.

See also: BulkBar · CopyLink · DataTable

Source

src/kit/patterns/PersonCell.tsx (line 21) on GitHub.

On this page