VB Project Planning

<work-item>

General-purpose work unit card for tasks, bugs, chores, spikes, and features — the engineering sibling of user-story.

Overview

A web component for engineering work units — tasks, bugs, chores, spikes, and features. While <user-story> captures product needs in agile format, <work-item> represents the implementation work: what needs to be built, fixed, researched, or maintained. A single story may decompose into multiple work items, and some work items exist independently of any story.

Attributes

AttributeValuesDefaultDescription
item-idstring—Unique work item identifier; sets the HTML id on first connect when none is set
type"task", "bug", "chore", "spike", "feature"taskItem type
priority"critical", "high", "medium", "low"mediumPriority
status"backlog", "to-do", "in-progress", "review", "done", "blocked"backlogWorkflow status
estimatestring—Effort estimate (points, hours, t-shirt size)
assigneestring—Assignee name (shown with initials avatar)
story-idsstring—Comma-separated linked user-story IDs
detail"full", "compact", "minimal"fullDetail level. minimal shows id, type and title only.
compactboolean—Alias for detail=compact
srcstring—URL of a JSON work-item record. Fetched once per value; a newer value aborts the older request.

Slots

SlotExpected ContentDescription
title<h3> or textWork item title displayed in the card header. The title is content, so there is no title attribute.
description<p>Work item description. Shows in the body section.
checklist<ul> or <ol>Subtasks or checklist items.
notes<p>Additional notes, context, or links.

Item Types

Each type gets a distinct icon and color badge in the header. Types are semantic — they help teams categorize work without requiring a separate labeling system.

TypeUse Case
taskEngineering implementation work (default)
bugDefect that needs fixing
choreTech debt, maintenance, or operational work
spikeResearch, investigation, or proof-of-concept
featureNew user-facing capability

Cross-Referencing

Work items connect to the broader UX Planning system through two mechanisms:

  • story-ids — links outward to <user-story> elements via fragment anchors. Rendered as clickable chips in the card body.
  • item-id — auto-set as the HTML id, enabling inbound references from <gantt-chart> rows via data-task-id matching.

Events

EventDetailDescription
work-item:ready{ itemId, title, type, priority, 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.
work-item:status{ status, itemId }When updateStatus() is called with a known status
work-item:priority{ priority, itemId }When updatePriority() is called with a known priority
work-item:upgraded—Once, in a microtask after first connect. Wait for this before assigning .data from a framework.
work-item:data-changed{ data, source: 'property' }After .data is assigned

Property API (JS-first)

The whole work item — state attributes and slotted content — can be set in one assignment. Useful when a reactive framework or kanban-board owns the data.

PropertyTypeDescription
.data{ itemId?, type?, priority?, status?, estimate?, assignee?, storyIds?, detail?, title?, description?, checklist?, notes? }Sets state attributes and creates slotted children for any text fields not already present (authored content wins). Idempotent.

Reading .data back returns the current shape — handy for persistence or logging. See the Data API concepts guide.

Assigning .data fires work-item:data-changed; frameworks should wait for work-item:upgraded first. With src, the JSON record (same shape as .data) is fetched once per value — moving the card between kanban columns does not refetch — and work-item:ready fires after it renders.

CSS Custom Properties

VariableDefaultDescription
--work-item-bg#ffffffCard background
--work-item-text#1a1a1aPrimary text
--work-item-border#e0e0e0Card border
--work-item-accent#0066ccInteractive color
--work-item-card-bg#f8f9faHeader background

Accessibility

  • Card is an <article> with aria-label="Work item: [item-id]"
  • Minimal cards (detail="minimal") are static summaries with no tab stop of their own; inside <kanban-board> the board makes the card itself focusable for keyboard moves
  • Type badge uses colored background for visual distinction (not color-only)
  • Story links are real <a> elements with fragment hrefs
  • Respects prefers-reduced-motion: reduce
  • Print styles remove shadows for clean output

Related

↑