VB Project Planning

<adr-wc>

Architectural Decision Record card in MADR format with status badges, slotted title/date content, context/decision/consequences sections, and supersedes chain linking.

Overview

A web component for rendering Architectural Decision Records (ADRs) in MADR format. The decision title and date are slotted content (headings and <time> elements), while status, supersedes chains, and detail level are attributes. Each card shows context, decision, and consequences with optional chain linking to other ADRs via fragment anchors.

Attributes

Attributes are for state and configuration — not content. The decision title and date are content and use slots instead.

AttributeValuesDefaultDescription
adr-idstring—ADR identifier (e.g., ADR-001); sets the HTML id on first connect when none is set
status"proposed", "accepted", "deprecated", "superseded"proposedDecision status
supersedesstring—Comma-separated ADR IDs this supersedes
superseded-bystring—Comma-separated ADR IDs that supersede this
detail"full", "compact", "minimal"fullDetail level. minimal shows id, status and title only.
compactboolean—Alias for detail=compact
srcstring—URL of a JSON ADR record. Fetched once per value; a newer value aborts the older request. A YYYY-MM-DD date is shown as that calendar day in every time zone.

Slots

SlotExpected ContentDescription
title<h2>, <h3>, etc.Decision heading — the author controls the heading level
date<time datetime="...">Decision date — machine-readable via datetime, human-readable via text content
context<p>Why the decision was needed
decision<p>What was decided
consequences<ul>Outcomes (prefix items with "Good:" or "Bad:" for clarity)

Supersedes Chain

ADRs form a decision evolution chain. Use supersedes and superseded-by to link related decisions. These render as clickable anchor chips that scroll to the referenced ADR card.

Status Colors

StatusColorMeaning
proposedBlueUnder discussion, not yet decided
acceptedGreenDecision is active and in effect
deprecatedAmberDecision is being phased out
supersededGrayReplaced by a newer decision

Events

EventDetailDescription
adr-wc:ready{ adrId, title, status }Once per element, after the first render at any detail level. With src, after the fetched data renders (not fired if the fetch fails). Not re-fired by attribute changes or moves.
adr-wc:upgraded—Once, in a microtask after first connect. Wait for this before assigning .data from a framework.
adr-wc:data-changed{ data, source: 'property' }After .data is assigned

JavaScript API

<adr-wc> follows the HTML-first + JS-first dual-mode contract. Reactive consumers (Montane, Lit, Solid, etc.) should wait for adr-wc:upgraded before assigning .data.

PropertyTypeDescription
.data { adrId?, title?, status?, date?, supersedes?, supersededBy?, context?, decision?, consequences? } Whole-record assignment. Sets state attributes and creates slotted children for any text fields not already present (authored content wins). A YYYY-MM-DD date is rendered as that calendar day in every time zone. Idempotent.

Accessibility

  • Card is an <article> with aria-label
  • The title slot accepts any heading level — the author controls the document outline
  • The date slot uses <time> for machine-readable dates
  • Status badge uses colored background (not color-only)
  • Supersedes/superseded-by links are real <a> elements
  • Minimal cards (detail="minimal") are static summaries, not tab stops; wrap one in a link if it should navigate somewhere
  • Respects prefers-reduced-motion: reduce

Related

  • <work-item> — Engineering work that implements decisions
  • <glossary-wc> — Define terms referenced in ADRs
  • <user-story> — Stories that drive architectural decisions
  • vb-project-planning — the whole package: import '@profpowell/vb-project-planning' registers every component
↑