Design system

Agent mark

The filled icon, in its own colour, that stands for one agent family.

import { AgentMark, agentIcon, AGENT_ICONS } from "@/components/AgentMark";

Every agent family in AGENTS (in src/mocks/agentWorkflows.js) has an icon name and a colour. This file turns the name into a Phosphor icon, so a family shows the same glyph on the Agents grid, the workflow graph and the Recommendations page. It has three exports:

  • AgentMark, the icon drawn filled in the family's colour, with a tooltip that names it.
  • agentIcon(agentKey), which returns the icon component for a family, for when you draw it yourself.
  • AGENT_ICONS, the map from icon name to component that agentIcon reads.

The families

{Object.values(AGENTS).map((a) => (
  <span key={a.key}>
    <AgentMark agentKey={a.key} /> {a.label}
  </span>
))}
KeyLabelIconColourTint
measurementMeasurementChartLineUp#3661ED#E0EBFE
budgetBudgetWallet#0F7B6C#E3F4F1
deliveryCampaignBroadcast#E0620D#FDEEE2
demandAudienceTarget#C4106A#FCE7F1
creativeCreative & messagePaintBrush#643BCF#EBE3FA
conversionConversionFunnelSimple#8A5524#F5EBE1
landingLanding pageBrowser#1E3A8A#E3E9F8

The colours and tints are set per family in AGENTS, not taken from the colour tokens. Only Measurement uses a token value (--color-primary-500). Keep these colours for agent families: do not reuse them for status, charts or anything else.

listAgents() leaves out creative, so the Agents page shows six families. The mark still works for it, because recommendations and workflow steps can name it.

Sizes

size sets the icon's width and height in pixels. The default is 20. In the product the family icon is drawn at 11px in pills, 16px in lists, 18px on the workflow graph and 20px in page and drawer headers.

<AgentMark agentKey="measurement" size={14} />
<AgentMark agentKey="measurement" size={16} />
<AgentMark agentKey="measurement" />
<AgentMark agentKey="measurement" size={24} />

In a row

A workflow uses several families. Put their marks side by side with a 2px gap, next to the workflow's name. Each mark names its family on hover.

<span className="inline-flex items-center gap-0.5">
  <AgentMark agentKey="measurement" size={16} />
  <AgentMark agentKey="demand" size={16} />
  <AgentMark agentKey="conversion" size={16} />
</span>
<span>LinkedIn buyer-title targeting</span>

Drawing the icon yourself

When the family's name is already printed, as in the pill the Recommendations page puts on each step of an analysis, take the icon from agentIcon and skip the tooltip. Draw it with weight="fill" so it matches the mark.

const a = AGENTS[agentKey];
const Icon = agentIcon(agentKey);

<span className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[12px] font-medium" style={{ background: a.tint, color: a.color }}>
  <Icon size={11} weight="fill" />
  {deckFamilyOf(agentKey)}
</span>

Props

AgentMark

PropTypeDefaultNotes
agentKeystringA key of AGENTS. An unknown key renders nothing.
sizenumber20Icon size in pixels.

There is no className and no way to change the colour or weight: the mark is always filled, in the family's colour.

agentIcon

SignatureagentIcon(agentKey: string) => PhosphorIcon
ReturnsThe icon component for the family. Circle when the key or its icon name is unknown.

Accessibility

  • The tooltip reads "Measurement agent" and so on: the family's label followed by "agent". It uses the Tooltip from @/ui. The mark is a plain <span> that cannot take focus, so the tooltip opens on hover only and keyboard users never see it.
  • The wrapper <span> carries the same text as aria-label, but it has no role, so most screen readers ignore that label. Where the family matters to someone using a screen reader, print its name next to the mark.
  • agentIcon returns a bare icon with no label. Use it only next to visible text.

Do and don't

  • Do use AgentMark or agentIcon for a family. Never pick a Phosphor icon for a family by hand, or two pages will disagree.
  • Do print the family name beside the icon when there is room. The tooltip is for rows of marks where there is not.
  • Don't use a family colour for anything that is not that family.
  • Don't add a family by editing this file. Add it to AGENTS, and add its icon to AGENT_ICONS only if the icon is new.

Where it is used

AgentMark itself has no callers in src/ today. Every page below takes the icon from agentIcon and colours it by hand.

FileWhat it draws
src/pages/agents/index.jsxThe 16px icon in each family's heading on the Agents page.
src/pages/agents/AgentDetail.jsxThe 20px icon in an agent's page header.
src/pages/workflows/index.jsxA row of 16px icons for the families a workflow uses, with one tooltip that lists them.
src/pages/workflows/WorkflowDetail.jsxThe 18px icons on the workflow graph's family nodes and in the hand-off list, and the 20px icon in the agent drawer's header.
src/pages/recommendations/index.jsxThe 11px icon in FamilyPill, on each step of "How this was analyzed".

On this page