Skip to Content
BBRICKSv0.7.4
Foundations

Icons

The kit's line icons, the PR portal's icons and how to use your own.

The library draws two small icon sets as inline SVG, so they follow currentColor and need no network or font:

  • Kit icons: Icon with a name from ICONS (used by KpiCard, TodoItem, the shell's navigation and the notification menu).
  • PR icons: PrIcon and IconSquare with a name from PR_ICONS.

Icons are decorative: they are aria-hidden, so give the control that holds one its own accessible name.

Kit icons

Every icon

The kit's line icons are drawn from one table (ICONS); size is in pixels and the colour is the text colour.

Code
import { ICONS, Icon, type IconName } from '@ergasti/bricks';

function All() {
  const names = Object.keys(ICONS) as IconName[];
  return (
    <ul style={{ listStyle: 'none', margin: 0, padding: 0, display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(104px, 1fr))', gap: 10 }}>
      {names.map((name) => (
        <li key={name} style={{ display: 'grid', justifyItems: 'center', gap: 6, padding: 12, background: 'var(--card)', borderRadius: 14, border: '1px solid var(--line)' }}>
          <Icon name={name} size={22} />
          <code style={{ fontSize: 12 }}>{name}</code>
        </li>
      ))}
    </ul>
  );
}

ICONS

constant

The mock's own icon set, path for path (its IC map plus the topbar's search, help and bell glyphs), on a 24-unit viewBox. Lucide stays only for icons the mock lacks (the screens under More).

const ICONS: { readonly home: "<path d=\"M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z\"/>"; readonly find: "<circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"M21 21l-4.3-4.3M11 8v6M8 11h6\"/>"; readonly creators: "<circle cx=\"9\" cy=\"8\" r=\"4\"/><path d=\"M2 21c0-4 3-6 7-6s7 2 7 6M17 4a4 4 0 0 1 0 8M22 21c0-3-1.5-5-4-5.7\"/>"; readonly coupons: "<path d=\"M3 9V5h18v4a3 3 0 0 0 0 6v4H3v-4a3 3 0 0 0 0-6z\"/><path d=\"M13 5v2M13 11v2M13 17v2\"/>"; readonly motivation: "<path d=\"M12 2l3 6.5 7 .8-5.2 4.8 1.5 7L12 17.6 5.7 21.1l1.5-7L2 9.3l7-.8z\"/>"; readonly payments: "<rect x=\"2\" y=\"5\" width= …

Source: src/kit/primitives/Icon.tsx (line 5)

PR icons

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>
  );
}

PR_ICONS

constant

The PR mock's icons that the kit's Icon set lacks (its IC map, path for path), plus three the PR blocks need for screens the mock leaves for later (upload, receipt, shield). Decorative: the label always sits beside it.

const PR_ICONS: { readonly approvals: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M8 12.5l2.5 2.5L16 9.5\"/>"; readonly brands: "<path d=\"M4 9l1.5-5h13L20 9M4 9v11h16V9M4 9h16M9 20v-6h6v6\"/>"; readonly star: "<path d=\"M12 2l3 6.5 7 .8-5.2 4.8 1.5 7L12 17.6 5.7 21.1l1.5-7L2 9.3l7-.8z\"/>"; readonly tiers: "<path d=\"M12 3l9 5-9 5-9-5z\"/><path d=\"M3 13l9 5 9-5\"/>"; readonly target: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"5\"/><circle cx=\"12\" cy=\"12\" r=\"1\"/>"; readonly trophy: "<path d=\"M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z\"/><path d=\"M17 5h3v2a3 3 0 0 1-3 3M7  …

Source: src/pr/PrIcon.tsx (line 5)

Your own

Components that take an icon accept either a name or a node (NavItem.icon is IconName | ReactNode, so the shell's examples use lucide-react icons next to the kit's). lucide-react is the library's only runtime dependency.

On this page