Skip to Content
BBRICKSv0.7.4
PR PortalStatus and icons

PrIcon

One of the PR Portal's line icons (the names in PR_ICONS) as an inline SVG sized by size. It is decorative: aria-hidden, with no accessible name of its own.

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

Examples

Every PR icon

The portal's line icons (PR_ICONS) as plain icons and as tinted squares in the six tones.

Code
import { IconSquare, PR_ICONS, PrIcon, type PrIconName } from '@ergasti/bricks';

function All() {
  const names = Object.keys(PR_ICONS) as PrIconName[];
  return (
    <div style={{ display: 'grid', gap: 16 }}>
      <ul style={{ listStyle: 'none', margin: 0, padding: 0, display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(96px, 1fr))', gap: 8 }}>
        {names.map((name) => <li key={name} style={{ display: 'grid', justifyItems: 'center', gap: 4, padding: 8, background: 'var(--card)', borderRadius: 12 }}><PrIcon name={name} size={22} /><code style={{ fontSize: 11 }}>{name}</code></li>)}
      </ul>
      <div style={{ display: 'flex', gap: 10, flexWrap: 'wrap', alignItems: 'center' }}>
        {(['rasp', 'butter', 'sky', 'lime', 'lilac', 'mute'] as const).map((tone) => <IconSquare key={tone} name="star" tone={tone} />)}
        <IconSquare name="wallet" tone="rasp" size="sm" /><IconSquare name="wallet" tone="sky" size="lg" />
      </div>
    </div>
  );
}

The gift glyph

gift (0.7.0) is the mock's gift box, for gift stock rows, nav items and an IconSquare, so a gift row no longer needs the kit Icon as an element.

Code
import { IconSquare, PrIcon } from '@ergasti/bricks';

function Gift() {
  return (
    <div style={{ display: 'flex', gap: 12, alignItems: 'center' }}>
      <PrIcon name="gift" size={22} />
      <IconSquare name="gift" tone="lime" />
      <IconSquare name="gift" tone="lilac" size="lg" />
    </div>
  );
}

Props

Prop

Type

Design guidance

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

The PR Portal's own stroke icon set (the mock's IC map, path for path); use it for glyphs the kit Icon set lacks inside PR screens.

PrIcon draws one icon from PR_ICONS as an inline svg in currentColor, so it takes the colour of its text. The set holds the PR mock's 31 glyphs (approvals, brands, star, tiers, trophy, wallet, receipt, shield, percent, …), three of which (upload, receipt, shield) serve PR screens the mock left for later. It is decorative: the label always sits beside it.

Anatomy

  1. svg: viewBox="0 0 24 24", class kit-pr-svg: fill: none, stroke: currentColor, stroke-width: 2, round caps and joins; fills its box (100%) unless size is given.
  2. Paths: the static markup for name from PR_ICONS (module strings only, never data).

Variants

PropValueLookWhen to use
nameany PrIconNamethe glyphSee the full set in the preview ("All")
sizenumber (px)fixed width and heightStandalone icons; omit inside IconSquare, banners and buttons, where the parent's CSS sizes it (13-22px)

States

Static. It follows the colour of its parent (hover or disabled colours of a button apply through currentColor).

Types

Also exported: PR_ICONS (the name → path map) and the PrIconName type.

Usage

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

<PrIcon name="wallet" size={18} />
// A kit Button with a PR glyph before the label
<Button variant="ghost" onClick={openUpload}>
  <PrIcon name="upload" size={16} /> Upload receipt
</Button>
// A ChoiceGroup option ("% of sale"): the square takes a PrIcon name
<ChoiceGroup
  label="How creators earn"
  value={type}
  onChange={setType}
  options={[
    { value: 'pct', title: '% of sale', description: 'A share of each delivered order', icon: 'percent', tone: 'rasp' },
    { value: 'egp', title: 'Fixed per item', description: 'A set amount per item sold', icon: 'cash', tone: 'sky' },
  ]}
/>

Every PR icon. The portal's line icons (PR_ICONS) as plain icons and as tinted squares in the six tones. (docs example All)

import { IconSquare, PR_ICONS, PrIcon, type PrIconName } from '@ergasti/bricks';

export function All() {
  const names = Object.keys(PR_ICONS) as PrIconName[];
  return (
    <div style={{ display: 'grid', gap: 16 }}>
      <ul style={{ listStyle: 'none', margin: 0, padding: 0, display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(96px, 1fr))', gap: 8 }}>
        {names.map((name) => <li key={name} style={{ display: 'grid', justifyItems: 'center', gap: 4, padding: 8, background: 'var(--card)', borderRadius: 12 }}><PrIcon name={name} size={22} /><code style={{ fontSize: 11 }}>{name}</code></li>)}
      </ul>
      <div style={{ display: 'flex', gap: 10, flexWrap: 'wrap', alignItems: 'center' }}>
        {(['rasp', 'butter', 'sky', 'lime', 'lilac', 'mute'] as const).map((tone) => <IconSquare key={tone} name="star" tone={tone} />)}
        <IconSquare name="wallet" tone="rasp" size="sm" /><IconSquare name="wallet" tone="sky" size="lg" />
      </div>
    </div>
  );
}

Where it appears

  • PR Portal › every page: inside IconSquare leads, PrEmpty, ReceiptUpload, LoginCard errors, banners and summary warnings.
  • PR Portal › Tiers › "Add a tier" rung (26px plus); a campaign's challenges. Also library-only fraud review.
  • Dashboard screens: PrHome, PrTiers, PrPrograms, PrLogin.

Guidelines

Do

  • Pair it with visible text; it is aria-hidden.
  • Let the parent size it; pass size only when it stands alone.
  • Use the kit Icon on Brand dashboard surfaces and PrIcon in PR blocks, so each surface keeps the mock's glyphs.

Don't

  • Don't fill it with a colour: it is a stroke icon, colour it through color.
  • Don't add new glyphs from data; PR_ICONS is static markup by design.

RTL and Arabic

Glyphs do not mirror automatically. Directional ones (arrow, chev) point right in both languages: a caller that needs a "forward" arrow in Arabic flips it in CSS.

Tokens

None of its own: currentColor. Sizes come from the parent's rules in pr.css.

Accessibility

aria-hidden="true" and focusable="false" on the svg. Give the control around it an accessible name (its text, or aria-label on an icon-only button).

Found in the source

  • ARIA attributes set: aria-hidden.

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

  • IconSquare: the icon in a tinted square.
  • Icon (kit): the shared icon set (approvals, brands, tiers, speech, logout, star also exist there for the shell nav).

See also: DecisionLine · DecisionTag · DecisionTagsProvider

Source

src/pr/PrIcon.tsx (line 44) on GitHub.

On this page