VB Project Planning

<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

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

SlotDescription
nameIlity label (e.g. "Performance").
badgeCategory / version / source tag, shown as small uppercase muted text.
priority-pillYour own pill. When empty, a default pill renders from data-priority.
rationaleWhy this priority was chosen (especially for Critical rows). The row collapses when empty.
conflictsShort conflict / drift note, usually paired with data-conflict. The row collapses when empty.

Attributes

AttributeValuesDefaultDescription
data-priority"critical", "important", "acceptable", "not-relevant"—Drives :state(priority-*), default pill text, and accent color
data-conflictboolean—Flag a conflict / drift note; renders an emphasized border
tabindexnumber—Set to 0 to make the card directly focusable + activatable (otherwise wrap in <a>/<button>)

Properties & events

MemberTypeDescription
priorityR/W stringMirror of data-priority, lower-cased. Setting an unknown value removes the attribute.
hasConflictR/W booleanMirror of data-conflict.
EventDetailDescription
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

StateWhen
:state(priority-critical), -important, -acceptable, -not-relevantMatches 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-conflictsThat 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.

CSS Tokens

Every token falls back to a Vanilla Breeze theme token, so the card follows light, dark, and brand themes without configuration.

TokenDefaultPurpose
--requirement-card-paddingvar(--size-m)Inner padding
--requirement-card-radiusvar(--radius-m)Corner radius
--requirement-card-gapvar(--size-2xs)Gap between rows
--requirement-card-surfacevar(--color-surface)Background
--requirement-card-border1px solid var(--color-border)Border shorthand (the priority colour then replaces its colour)
--requirement-card-textvar(--color-text)Text colour
--requirement-card-mutedvar(--color-text-muted)Badge and rationale colour
--requirement-card-critical-bg / -fgvar(--color-error-subtle) / var(--color-error)Critical pill and border
--requirement-card-important-bg / -fgvar(--color-warning-subtle) / var(--color-warning)Important pill and border
--requirement-card-acceptable-bg / -fgvar(--color-success-subtle) / var(--color-success)Acceptable pill and border
--requirement-card-skipped-bg / -fgvar(--color-surface-raised) / var(--color-text-muted)Not relevant pill
--requirement-card-conflict-colorvar(--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 gets role="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 add tabindex to 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).
↑