Skip to Content
BBRICKSv0.7.4
PR PortalChallenges

CreatorPickDialog

"Add creators" (the PR v3 mock's addCreators, opened from a challenge's page): a kit Modal listing approved creators, each a checkbox row with the photo, the name and the tier chip; a search over the names, how many are selected, Cancel and "Send invites (N)". Controlled: the app holds selected and does the sending (busy, error). The search is the dialog's own state, and starts empty each time the dialog opens.

import { CreatorPickDialog } from '@ergasti/bricks';

Examples

Add creators

A challenge page's "Add creators": approved creators with their tier chips, a search, the selected count and "Send invites (N)". Controlled: the app holds selected, sends, and passes busy and error.

Code
import { useState } from 'react';
import { Button, CreatorPickDialog, type PickCreator } from '@ergasti/bricks';

const approved: PickCreator[] = [
  { id: 1, seed: 2, name: 'Nour Hassan', tier: 'elite' }, { id: 2, seed: 1, name: 'Sara Ali', tier: 'established' }, { id: 3, seed: 3, name: 'Hana Rami', tier: 'influential' },
  { id: 4, seed: 4, name: 'Youssef Adel', tier: 'established' }, { id: 5, seed: 0, name: 'Mai Samir', tier: 'rising' },
];

function AddCreators() {
  const [open, setOpen] = useState(false);
  const [selected, setSelected] = useState<ReadonlyArray<string | number>>([]);
  const [busy, setBusy] = useState(false);
  const send = () => { setBusy(true); setTimeout(() => { setBusy(false); setSelected([]); setOpen(false); }, 800); };
  return (
    <>
      <Button onClick={() => setOpen(true)}>Add creators</Button>
      <CreatorPickDialog open={open} onClose={() => setOpen(false)} creators={approved} selected={selected} onChange={setSelected} onSend={send} busy={busy} />
    </>
  );
}

Sending failed

error shows over the buttons as an alert; the ticks stay.

Code (not run)
import { useState } from 'react';
import { CreatorPickDialog, type PickCreator } from '@ergasti/bricks';

const approved: PickCreator[] = [
  { id: 1, seed: 2, name: 'Nour Hassan', tier: 'elite' }, { id: 2, seed: 1, name: 'Sara Ali', tier: 'established' }, { id: 3, seed: 3, name: 'Hana Rami', tier: 'influential' },
  { id: 4, seed: 4, name: 'Youssef Adel', tier: 'established' }, { id: 5, seed: 0, name: 'Mai Samir', tier: 'rising' },
];

function Failed() {
  const [selected, setSelected] = useState<ReadonlyArray<string | number>>([2, 4]);
  return <CreatorPickDialog open onClose={() => {}} creators={approved} selected={selected} onChange={setSelected} onSend={() => {}} error="The invites could not be sent. Try again." />;
}

In Arabic

Pinned to Arabic
Code (not run)
import { useState } from 'react';
import { CreatorPickDialog, type PickCreator } from '@ergasti/bricks';

const approved: PickCreator[] = [
  { id: 1, seed: 2, name: 'Nour Hassan', tier: 'elite' }, { id: 2, seed: 1, name: 'Sara Ali', tier: 'established' }, { id: 3, seed: 3, name: 'Hana Rami', tier: 'influential' },
  { id: 4, seed: 4, name: 'Youssef Adel', tier: 'established' }, { id: 5, seed: 0, name: 'Mai Samir', tier: 'rising' },
];

function Arabic() {
  const [selected, setSelected] = useState<ReadonlyArray<string | number>>([1]);
  return <CreatorPickDialog open onClose={() => {}} creators={approved} selected={selected} onChange={setSelected} onSend={() => {}} language="ar" />;
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prCreatorPick, or with the component's own prop where it has one. A {name} is a value the component fills in.

prCreatorPick
KeyEnglishArabic
titleAdd creatorsزوّد صنّاع محتوى
hintThey get an invite in the app. Only approved creators are listed.هيوصلهم دعوة في التطبيق. صنّاع المحتوى المتوافق عليهم بس هم اللي ظاهرين.
searchSearch creatorsدوّر على صانع محتوى
listApproved creatorsصنّاع المحتوى المتوافق عليهم
selected{n} selectedاخترت {n}
sendSend invitesابعت الدعوات
sendNSend invites ({n})ابعت الدعوات ({n})
busySending…بيتبعت…
cancelCancelإلغاء
noneNo approved creators to invite.مفيش صنّاع محتوى متوافق عليهم تدعوهم.
noMatchNo creator matches your search.مفيش صانع محتوى بالاسم ده.

Design guidance

How the BRICKS design system uses CreatorPickDialog. Written in docs/content/components/CreatorPickDialog.md; the props above are read from the code, which wins where the two disagree.

"Add creators": a modal listing approved creators as checkbox rows (photo, name, tier) with a search, a selected count and "Send invites (N)"; use it from a challenge's page to invite specific creators.

CreatorPickDialog is the PR v3 mock's addCreators overlay ("They get an invite in the app. Only approved creators are listed."), which the design system used to compose by hand, opened from the Add creators button on a challenge's page. It is controlled: the app filters the list (approved, not already in), holds selected, sends the invites and reports busy / error. The search is the dialog's own and starts empty on each open.

Anatomy

  1. Modal: the kit Modal, title "Add creators", the hint, close ×, scrim.
  2. Search row (.kit-pr-cpick-h, when there are creators): a pill search input "Search creators" and the live count "2 selected".
  3. List (.kit-pr-cpick-l, max 300px, scrolls): one <label> row per creator on --soft, 16px radius: a 20px checkbox (ink when ticked), Avatar + bold name, TierChip at the end (when tier). A ticked row turns --rasp-50.
  4. Empty line: "No approved creators to invite." or "No creator matches your search.".
  5. Footer: an error alert (with error), Cancel (default), Send invites (N) (ink).

Variants

CreatorPickDialog has no visual variants. A row without tier has no chip; avatarUrl replaces the initials; seed picks the avatar colour.

States

StateTrigger
None selectedselected=[]: "Send invites", disabled
Selectedselected=[2, 4]: "Send invites (2)", ticked rows tinted
Searchingtyping filters names (case-insensitive); ticks outside the filter stay
No matcha search with no hit: "No creator matches your search."
Emptycreators=[]: no search row, "No approved creators to invite."
Busybusy: checkboxes and both buttons disabled, Send reads "Sending…", aria-busy
Errorerror: role="alert" line over the buttons; ticks stay

Usage

import { useState } from 'react';
import { Button, CreatorPickDialog, type PickCreator } from '@ergasti/bricks';

const approved: PickCreator[] = [
  { id: 1, name: 'Nour Hassan', tier: 'elite' }, { id: 2, name: 'Sara Ali', tier: 'established' },
  { id: 3, name: 'Hana Rami', tier: 'influential' }, { id: 4, name: 'Youssef Adel', tier: 'established' }, { id: 5, name: 'Mai Samir', tier: 'rising' },
];

export function AddCreators() {
  const [open, setOpen] = useState(false);
  const [selected, setSelected] = useState<ReadonlyArray<string | number>>([]);
  const [busy, setBusy] = useState(false);
  const [error, setError] = useState<string | null>(null);
  const send = (ids: ReadonlyArray<string | number>) => {
    setBusy(true);
    setError(null);
    fetch('/api/challenges/winter-top-10/invites', { method: 'POST', body: JSON.stringify({ ids }) })
      .then(() => { setSelected([]); setOpen(false); })
      .catch(() => setError('The invites could not be sent. Try again.'))
      .finally(() => setBusy(false));
  };
  return (
    <>
      <Button onClick={() => setOpen(true)}>Add creators</Button>
      <CreatorPickDialog open={open} onClose={() => setOpen(false)} creators={approved} selected={selected} onChange={setSelected} onSend={send} busy={busy} error={error} />
    </>
  );
}

Where it appears

  • PR Portal › Affiliate programs › Challenges › a challenge (Winter top 10) › header Add creators (the mock's addCreators). Screen: PR · Challenge.

Guidelines

Do

  • Offer only approved creators who are not in yet; leave customer affiliates out (they can't join challenges).
  • Clear selected and close the dialog once the invites are sent.
  • Keep the dialog open with error when sending fails.

Don't

  • Don't preselect creators; PR ticks who to invite.
  • Don't page the list; it scrolls inside the dialog and the search narrows it.
  • Don't restyle the send button: the component and the mock commit in ink.

RTL and Arabic

Rows mirror (checkbox on the right, tier chip on the left) and the tick mark flips. Names and the error are dir="auto". Arabic: "زوّد صنّاع محتوى", "دوّر على صانع محتوى", "اخترت 2", "ابعت الدعوات (2)", "بيتبعت…". Override with labels or labels.prCreatorPick.

Tokens

--line, --card, --ink, --ink-3, --soft, --rasp-50, --rasp (checkbox focus), --bad, --dlg-title-fs (Modal).

Accessibility

  • Kit Modal: role="dialog", aria-modal, named by the title; focus trapped, Escape and scrim close, focus returns.
  • Each row is a <label> around a native checkbox, so the whole row toggles it.
  • The list is named "Approved creators" and described by the selected count, which is aria-live="polite".
  • The search has aria-label="Search creators"; rows and the search field are 44px tall under 1024px.
  • The error is role="alert".

Found in the source

  • Roles in the markup: alert.
  • ARIA attributes set: aria-busy, aria-label, aria-live, aria-describedby.
  • Its tests cover: “the search narrows the list (ticks are kept) and says when nothing matches”; “busy disables the list and the buttons; an error is an alert; Cancel and Escape close”.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Avatar · Button · Modal · TierChip · useLanguage · BrandRequestCard · BuilderStepCard · ChallengeBasicsFields

Source

src/pr/creators/CreatorPickDialog.tsx (line 69) on GitHub.

On this page