<requirement-card>
Display-only card for one NFR ility row. Renders priority + rationale + optional conflict flag for status dashboards and ADR appendices.
Overview
The <requirement-card> component is a display-only tile for a single Non-Functional Requirement (ility) row — performance, security, accessibility, observability, and so on. It renders the chosen priority, a rationale, and an optional conflict flag for status dashboards, ADR appendices, and review surfaces.
The prioritization decision happens in <quality-target>. Use <requirement-card> downstream of that decision — in the documents that consume the choice. It is shadow-DOM encapsulated, with the ility name, an optional badge, the rationale, and any conflict note supplied through named slots.
Basic example
<requirement-card data-priority="critical"> <span slot="name">Performance</span> <span slot="badge">SLA</span> <p slot="rationale">Pages must paint LCP < 2.5s on 3G — a hard ad-network constraint.</p></requirement-card> <requirement-card data-priority="important"> <span slot="name">Accessibility</span> <p slot="rationale">WCAG 2.2 AA across all customer-facing flows.</p></requirement-card> <requirement-card data-priority="acceptable" data-conflict> <span slot="name">Internationalization</span> <p slot="rationale">English-only at launch; defer i18n to v2.</p> <p slot="conflicts">Conflicts with the marketing team's APAC-launch ask — needs an ADR.</p></requirement-card>
How it works
The data-priority enum drives a :state(priority-*) hook, the default pill text, and the accent color. Add data-conflict to flag a drift or contradiction note; the card renders an emphasized border and exposes the conflicts slot. The card is inert by default — set tabindex="0" (or wrap it in an <a> / <button>) to make it activatable, at which point it emits requirement-card:click with { priority, hasConflict, originalEvent }.
The card never navigates by itself. Listen for requirement-card:click to route, or wrap it in an <a href> and let the link navigate while the event still fires for analytics or in-app routing.
Slots
| Slot | Description |
|---|---|
name | Ility label (e.g. "Performance"). |
badge | Category / version / source tag, shown as small uppercase muted text. |
priority-pill | Your own pill. When empty, a default pill renders from data-priority. |
rationale | Why this priority was chosen (especially for Critical rows). The row collapses when empty. |
conflicts | Short conflict / drift note, usually paired with data-conflict. The row collapses when empty. |
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
data-priority | "critical", "important", "acceptable", "not-relevant" | — | Drives :state(priority-*), default pill text, and accent color |
data-conflict | boolean | — | Flag a conflict / drift note; renders an emphasized border |
tabindex | number | — | Set to 0 to make the card directly focusable + activatable (otherwise wrap in <a>/<button>) |
Properties & events
| Member | Type | Description |
|---|---|---|
priority | R/W string | Mirror of data-priority, lower-cased. Setting an unknown value removes the attribute. |
hasConflict | R/W boolean | Mirror of data-conflict. |
| Event | Detail | Description |
|---|---|---|
requirement-card:click | { priority, hasConflict, originalEvent } | Bubbles when the card is activated by mouse, keyboard, or touch (only when the card is interactive — wrapped in <a>/<button> or has tabindex) |
States
| State | When |
|---|---|
:state(priority-critical), -important, -acceptable, -not-relevant | Matches data-priority. Drives the border and default pill colours; Not relevant gives the card a dashed border, a muted name and a struck-through pill (no opacity, so text keeps AA contrast). |
:state(has-badge), has-priority-pill, has-rationale, has-conflicts | That slot has real content (whitespace doesn't count). has-priority-pill hides the default pill. |
:state(interactive) | The card has a tabindex or sits inside an <a href> / <button>. Adds the pointer cursor and hover tint. |
CSS parts
The card renders in shadow DOM, so style its insides with ::part(): card, head, name, badge, pill, priority-default (the generated pill), rationale, and conflicts.
requirement-card::part(priority-default) { letter-spacing: 0; text-transform: none;}
CSS Tokens
Every token falls back to a Vanilla Breeze theme token, so the card follows light, dark, and brand themes without configuration.
| Token | Default | Purpose |
|---|---|---|
--requirement-card-padding | var(--size-m) | Inner padding |
--requirement-card-radius | var(--radius-m) | Corner radius |
--requirement-card-gap | var(--size-2xs) | Gap between rows |
--requirement-card-surface | var(--color-surface) | Background |
--requirement-card-border | 1px solid var(--color-border) | Border shorthand (the priority colour then replaces its colour) |
--requirement-card-text | var(--color-text) | Text colour |
--requirement-card-muted | var(--color-text-muted) | Badge and rationale colour |
--requirement-card-critical-bg / -fg | var(--color-error-subtle) / var(--color-error) | Critical pill and border |
--requirement-card-important-bg / -fg | var(--color-warning-subtle) / var(--color-warning) | Important pill and border |
--requirement-card-acceptable-bg / -fg | var(--color-success-subtle) / var(--color-success) | Acceptable pill and border |
--requirement-card-skipped-bg / -fg | var(--color-surface-raised) / var(--color-text-muted) | Not relevant pill |
--requirement-card-conflict-color | var(--color-error) | Conflict border, inset ring, and note text |
Accessibility
- Never colour-only. Priority is conveyed by the pill's text label, not by accent colour alone, so the critical / important / acceptable / not-relevant distinction survives for low-vision and colour-blind readers. The conflict note is real slotted prose, so screen readers announce why a row is flagged rather than just seeing an emphasized border.
- Opt-in interactivity. The card stays non-interactive (no spurious focus stop) until you opt in.
- With
tabindex. The card getsrole="button"(unless you set your own role) and activates on click, Enter, and Space. Give it an accessible name that says where it goes if the slotted name isn't enough. - Wrapped in
<a href>/<button>. The native element supplies the role and focus. Its own keyboard activation fires the event too, so mouse, keyboard, and touch all behave the same. Don't also addtabindexto the card in this case, or keyboard users hit two focus stops.
Related
<quality-target>— the polygon-as-UI surface that produces the priorities this card displays.<iron-triangle>— project-shape decision (scope / time / cost) that sets the capacity those priorities are spent against.<capacity-plan>— ledger view of the same capacity-versus-quality math.<score-card>— KPI tile (a different shape with a numeric value + change indicator).