Skip to Content
BBRICKSv0.7.4
KitPrimitives

Icon

Decorative: the label sits beside it, so it is hidden from assistive tech. Stroked in the text colour (2px, round joins) by default, so it draws right outside a kit block too; a block's own CSS may restyle it.

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

Examples

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

Sizes and colour

Icons use currentColor, so they follow the text.

Code
import { Icon } from '@ergasti/bricks';

function Sizes() {
  return (
    <div style={{ display: 'flex', gap: 16, alignItems: 'center', color: 'var(--rasp)' }}>
      <Icon name="wallet" size={16} />
      <Icon name="wallet" size={24} />
      <Icon name="wallet" size={40} />
    </div>
  );
}

Sign out

logout is the PR mock's sign-out arrow, for the button at the end of the sidebar's user row. The icon is decorative, so the button carries the name.

Code
import { Icon } from '@ergasti/bricks';

function SignOut() {
  return (
    <button type="button" aria-label="Sign out" title="Sign out" style={{ display: 'grid', placeItems: 'center', width: 44, height: 44, border: 0, borderRadius: 12, background: '#141414', color: '#9A9DA8', cursor: 'pointer' }}>
      <Icon name="logout" size={18} />
    </button>
  );
}

Messages

messages is the v3 mocks' speech bubble, for the PR portal's Messages screen and its KPI card.

Code
import { Icon } from '@ergasti/bricks';

function Messages() {
  return (
    <span style={{ display: 'inline-flex', gap: 8, alignItems: 'center', fontWeight: 600 }}>
      <Icon name="messages" size={20} />
      Messages
    </span>
  );
}

Props

Prop

Type

Design guidance

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

The mock's own 24-unit stroke icon set as one component; use it for navigation glyphs, platform glyphs and small inline symbols next to a label.

Icon draws one of the mock's IC paths (plus the topbar's search, help and bell) as an inline SVG, stroked in the current text colour at 2px with round caps and joins. With no size it is 1em, so it matches the text beside it and is never 0 × 0; a kit block's CSS (.kit-btn svg at 15px, .kit-plat svg at 13px …) still wins over the attributes. It is always decorative: the label beside it carries the meaning.

Anatomy

  1. SVG (viewBox="0 0 24 24", fill="none", stroke="currentColor", width 2, aria-hidden, focusable="false").
  2. Paths: a static string from the module's ICONS map (never data).

Variants

name (IconName), grouped by use:

GroupNames
Brand navigationhome, find, creators, coupons, motivation, payments, analytics, log, settings
PR Portal navigationapprovals, brands, tiers, messages, speech, logout
Platformsig, tt, yt
Topbarsearch, help, bell, user, mail
Actionscopy, check, plus, pause, reset, undo, stop, eye, file
Status / infoinfo, alert, lock, clock, flag, star
Thingswallet, seat, gift, chart

size: omit for 1em; pass a number for fixed pixels.

States

None of its own; it inherits colour from its parent (hover/disabled come from the host).

Types

Also exported: ICONS (the path map) and the IconName type.

Usage

<Button size="sm"><Icon name="plus" /> Record gifts for a brand</Button>

A platform glyph with a hidden name (what PlatformPill does):

<span className="kit-plat" dir="ltr"><Icon name="ig" /><span className="kit-sr">Instagram </span>48.2K</span>

Fixed size in your own block:

<span style={{ color: 'var(--rasp)' }}><Icon name="gift" size={20} /></span>

Where it appears

  • Sidebar and bottom nav of both dashboards (navigation names).
  • Topbar search, help and notifications bell.
  • Followers cells (platform glyphs), ProofButton (file/eye), Banner and KpiCard icons, ListToolbar search glyph.
  • PR Portal header tool "+ Record gifts for a brand" (plus).

Guidelines

Do

  • Always pair it with visible text or an accessible name on the parent control.
  • Let the host size it; pass size only outside kit blocks.

Don't

  • Don't use an icon as the only content of a button without an aria-label on the button.
  • Don't inject your own SVG strings; add names to the set in the library instead.

RTL and Arabic

  • Glyphs do not mirror automatically. Directional ones (undo, logout) keep their drawn direction; flip with CSS in your block if needed.

Tokens

None directly: colour is currentColor.

Accessibility

  • aria-hidden="true" and focusable="false": never announced, never a tab stop.
  • Uses currentColor, so it meets the same contrast as its text.

Found in the source

  • ARIA attributes set: aria-hidden.
  • Its tests cover: “carries the PR mock sign-out arrow as ”.

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

  • PrIcon: the PR Portal's own icon set.
  • IconSquare: an icon on a tinted rounded square (KPI and banner leads).

See also: Avatar · AvatarStack · Button · ButtonLink

Source

src/kit/primitives/Icon.tsx (line 75) on GitHub.

On this page