j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

Card

A bordered panel that groups a title, body and metadata; a link card makes the whole panel one link, a selectable card is an option with the selection fill.

stable · light DOM · 4.0.0. Light DOM retains static content, native semantics, label relationships and host composition without duplicating controls.

Live variants

default

Window gaps

Inner 14px, outer −2px; the bar sits above the gap and the border is 1px.

Decided in D-009 · 3 fixtures

Markup
<j3w1-card id="example-card-default"><article class="card">
  <h3 class="card-title">Window gaps</h3>
  <p class="card-body">Inner 14px, outer −2px; the bar sits above the gap and the border is 1px.</p>
  <p class="card-meta">Decided in D-009 · 3 fixtures</p>
</article></j3w1-card>

link-card

Markup
<j3w1-card id="example-card-link-card"><a class="card card-link card-demo-target" href="#example-card-link-card-card-focus">
  <span class="card-title">Focus ring</span>
  <span class="card-body">One dashed pixel at −2px on controls; two solid pixels at −3px on containers.</span>
  <span class="card-meta">Decided in D-006 · 5 fixtures</span>
</a><p id="example-card-link-card-card-focus" tabindex="-1" class="j3w1-example-target">Example destination: card focus</p></j3w1-card>

selectable

Tiling Windows fill the screen without overlap; the gap is the only ornament. Default
Floating Windows overlap and carry the one shadow the theme permits. Dialogs and tools
Markup
<j3w1-card id="example-card-selectable"><div class="card-group" role="listbox" aria-label="Layouts">
  <div class="card card-selectable" role="option" aria-selected="false" tabindex="0">
    <span class="card-title">Tiling</span>
    <span class="card-body">Windows fill the screen without overlap; the gap is the only ornament.</span>
    <span class="card-meta">Default</span>
  </div>
  <div class="card card-selectable card-demo-target" role="option" aria-selected="false" tabindex="-1">
    <span class="card-title">Floating</span>
    <span class="card-body">Windows overlap and carry the one shadow the theme permits.</span>
    <span class="card-meta">Dialogs and tools</span>
  </div>
</div></j3w1-card>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@4.0.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/card.css';
import '@j3w1/ui/register/card';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@4.0.0 j3w1-ui copy card --out ./vendor/j3w1/card

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.

events

NameType / signatureMeaning

Dependencies and verification

Registered components: none. Style dependencies: none.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

Card card

  • Family: Information display
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Native control: native article or section; link cards are a single anchor; selectable cards are options inside a listbox — APG pattern
  • specified
  • demonstrated

A bordered panel that groups a title, body and metadata; a link card makes the whole panel one link, a selectable card is an option with the selection fill.

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
root.bgcolor.surface.defaultapproveduse#0d0707D-041 surface.default: color.primitive.modern.panel.
root.bordercolor.border.defaultapproveduse#482b2bD-041 border.default: color.primitive.modern.divider.
root.bg-hovercolor.interaction.hover.bgapproveduse#1c1010D-041 interaction.hover.bg: color.primitive.modern.hover.
root.border-hovercolor.border.controlapproveduse#c81a1aD-041 owner correction: red control and floating-frame borders, distinct from rose text.
root.ringcolor.interaction.focus.ring-containerobserveduse#ffa2a7Focus colour for containers and explicitly mapped filled controls (D-015); component rules determine ring geometry.
title.textcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
body.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
meta.textcolor.text.mutedapproveduse#d4868bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
selected.bgcolor.interaction.selection.bgapproveduse#531310Selected row, tab, workspace; D-027 recessed the fill, leaving the 2px indicator and the check to carry selection.
selected.textcolor.interaction.selection.textobserveduse#f4eeeeText on the selection.
selected.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateDefaultLink cardSelectable
default

Window gaps

Inner 14px, outer −2px; the bar sits above the gap and the border is 1px.

Decided in D-009 · 3 fixtures

Tiling Windows fill the screen without overlap; the gap is the only ornament. Default
Floating Windows overlap and carry the one shadow the theme permits. Dialogs and tools
hover
focus-visible
selected
selected+focus-visible

Purpose

Groups a title, a line or two and a metadata line so they read as one thing. Static by default; a link when the whole unit leads somewhere, an option when the user picks among units. Not a dialog, a form or a table row.

Anatomy

Parts as listed in the anatomy. Padding 12px in comfortable, 8px in compact.

States

StateVisualNon-colour channel
default1px color.border.default on color.surface.default—
hoverlink and selectable cards only: background → color.interaction.hover.bg; border → color.border.controlcursor: pointer; the border lightens from decorative to control
focus-visiblecontainer ring 2px solid color.interaction.focus.ring-container at −3pxthe ring
selectedfill color.interaction.selection.bg, color.interaction.selection.text on every linearia-selected="true"; the on-fill text
selected+focus-visiblethe fill and 1px dashed color.interaction.focus.ring at −2pxboth visible at once

A static card has no hover and no focus, and is not in the tab order.

Keyboard

A link card may hold no controls (a link cannot contain a button). A static card contributes only the controls it contains to the tab order.

Accessibility

A static card is an article with a heading when it stands alone, or a section inside a list. A link card names itself from its content, title first. A selectable group’s listbox carries aria-label. On the selection fill every line takes the on-fill text, because muted text would fall below 4.5:1. Text meets 4.5:1; the ring 3:1 on the card and on the fill.

Portability

A bordered box with a background and an outline. Toolkits that shadow their frames remove it. A host without outlines draws a 2px inner border for the container ring, 1px for the selected card, and records it.

Non-examples

A shadow or elevation. Rounded corners. A hover lift or scale. A hover fill on a static card. An invisible overlay as the only clickable part. A link card containing buttons. A selected card shown by border colour alone, without the fill and aria-selected. Muted metadata left on the selection fill.

Contrast report

13 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 0 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
card default textdefaulttextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
card hover texthovertextcolor.text.default #e99499color.interaction.hover.bg #1c10108.104.5pass
card hover borderhoveruicolor.border.control #c81a1acolor.interaction.hover.bg #1c10103.203pass
card focus-visible textfocus-visibletextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
card focus-visible outlinefocus-visibleuicolor.interaction.focus.ring-container #ffa2a7color.surface.default #0d070710.453pass
card selected textselectedtextcolor.interaction.selection.text #f4eeeecolor.interaction.selection.bg #53131012.474.5pass
card selected+focus-visible textselected+focus-visibletextcolor.interaction.selection.text #f4eeeecolor.interaction.selection.bg #53131012.474.5pass
card selected+focus-visible outlineselected+focus-visibleuicolor.interaction.focus.ring #e53935color.interaction.selection.bg #5313103.383pass
title on the card—textcolor.text.bright #ffa2a7color.surface.default #0d070710.454.5pass
metadata on the card—textcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass
title on the hover fillhovertextcolor.text.bright #ffa2a7color.interaction.hover.bg #1c10109.714.5pass
metadata on the hover fillhovertextcolor.text.muted #d4868bcolor.interaction.hover.bg #1c10106.704.5pass
card edge (decorative; the card is not a control at rest)—uicolor.border.default #482b2bcolor.surface.default #0d07071.581pass

Keys

KeyAction
TabReaches a link card as one stop; reaches a selectable group at its selected card (roving tabindex).
EnterFollows a link card.
Up / Down / Left / RightMoves between selectable cards in the group and selects the focused one.
SpaceToggles the focused card in a multi-select group.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: list link button table

Stress fixtures: FX-LONG FX-320 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-STATE-MATRIX