CitationChip

Molecule

A numbered evidence chip [1] that links to its evidence row (a same-page anchor, so it works without JavaScript), drawn with the same DOM as kui-react. A citation that points at nothing renders as a dashed "dropped" chip with a warning icon and text, never as a dead link. `onSelect` is the bubbling DOM event `kui:citation-select` { evidenceId }, fired by a small idempotent script (`modules/ui/Evidence/scripts/evidence.js`, inlined once per chip unless `loadRuntime: false`). The output has no leading or trailing whitespace: it sits inside running text. `className` is appended; unlike React there is no tailwind-merge to resolve conflicts.

Cited and dropped

Preview

Failures are gateway timeouts[1] and the database was slow[7].

Code
<%- include('modules/ui/CitationChip', { index: 1, evidenceId: 'e-log', title: '…' }) %>
<%- include('modules/ui/CitationChip', { index: 7, evidenceId: '7', status: 'dropped' }) %>

Listening for a click

Preview

Checkout errors began after the rollout[3]

Use the chip.

Code
<%- include('modules/ui/CitationChip', { index: 3, evidenceId: 'e-deploy', title: 'payments 4.12.0' }) %>
<script>
  document.addEventListener('kui:citation-select', function (e) {
    // e.detail = { evidenceId: 'e-deploy' }
  });
</script>
Source modules/ui/CitationChip.ejs