Canvas Design System
Main Site Tokens

Source Chip

Where a line in an AI result came from: a glyph for the kind of source, a short label, and a link back to it, so the person can check the claim against what was actually said.

When to Use

Use when: The AI wrote something from material the person gave it and the person should be able to trace it: after each sentence of a Synthesize recap, beside a quote in an Impact Report, under a theme built from notes. One chip per source, straight after the claim it supports.
Don't use when: It is a topic or metadata tag (Pill), a status or a count (Badge), or an ordinary link in running text that is not saying where a claim came from.

Variants

In a recap

Chips sit inline after the sentence they support. Keep the label short and specific: whose note and when, which poll and how many voted.

Pricing won the vote, 9 of 12. From a poll: Poll 3, 9 of 12 From a note: Your note 10:31 Enterprise SSO was the closest miss; two leaders asked for it to come back next quarter. From a recording: Recording 10:18

Pricing won the vote, 9 of 12. <?= ws_source_chip('Poll 3, 9 of 12', ['kind' => 'poll', 'href' => '#poll-3']) ?>

Every kind

kind picks the glyph and the words a screen reader hears first. Leave it out and the chip has no glyph.

From a note: Your note 10:31 From a recording: Recording 10:18 From a photo: Whiteboard photo From a document: Pre-read.pdf From a board: Miro board From a poll: Poll 3

Unlinked

When the source can no longer be opened (deleted, or never uploaded), 'unlinked' => true drops the link, dashes the border and says "not linked" in words.

From a photo: Whiteboard photonot linked
<?= ws_source_chip('Whiteboard photo', ['kind' => 'photo', 'unlinked' => true]) ?>

From JavaScript

WsAgent.sourceChip(label, options) in /js/ws-agent.js prints the same markup for a recap drawn in the browser.

line.insertAdjacentHTML('beforeend', ' ' + WsAgent.sourceChip('Help request 10:18', { kind: 'recording', href: '#help-3' }));

States

StateBehavior
LinkedAn <a>. Hover turns it to the brand tint; keyboard focus draws the focus ring.
PlainNo href: a <span>, for a source that has nowhere to open.
UnlinkedA <span> with a dashed border and the words "not linked".

Options

OptionTypeDefaultPurpose
$labelstringShort name of the source
kindstringnullnote | recording | photo | document | board | poll
hrefstring''Where the source opens; renders a link
unlinkedboolfalseThe source can no longer be opened
id / class / attrsstring / string / arrayElement id, classes and attributes

Accessibility

ConcernBehavior
ElementA link when it has href, plain text when not, so only chips that go somewhere are in the Tab order.
Kind in wordsThe glyph is aria-hidden; visually hidden words give the kind before the label ("From a poll: Poll 3, 9 of 12"), or "Source:" when there is no kind.
UnlinkedSays "not linked" in visible text, so the dashed border is never the only sign.
FocusThe sky-blue focus ring, offset from the chip.

Tokens

TokenUsed for
--gray-100 / --gray-200 / --gray-300Fill and borders
--brand-tint / --brand-line / --brand-inkHover on a linked chip
--text-caption / --radius-smSize and shape, small enough to sit inside a sentence
--focus-ring / --focus-ring-offsetKeyboard focus

CSS Classes

ClassPurpose
.ws-source-chipThe chip; --unlinked when the source cannot be opened
.ws-source-chip__glyphThe kind's glyph
.ws-source-chip__labelThe label, which truncates rather than wraps
.ws-source-chip__stateThe words "not linked"

Files

FilePurpose
includes/components/helpers.phpws_source_chip() helper
includes/components/source-chip.phpTemplate
includes/components/components.cssStyles, in the agent components section
js/ws-agent.jsWsAgent.sourceChip(), the JavaScript twin