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

List

A selectable list of rows (an APG listbox) in single or multiple selection; the selected row is the selection fill with a check glyph and an optional metadata column.

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

Live variants

single

  • default
  • extended
  • high-contrast
  • print
Markup
<j3w1-list id="example-list-single"><ul class="list" role="listbox" aria-label="Profiles">
  <li class="list-option" role="option" aria-selected="true" tabindex="0"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">default</span></li>
  <li class="list-option list-option-demo-target" role="option" aria-selected="false" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">extended</span></li>
  <li class="list-option" role="option" aria-selected="false" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">high-contrast</span></li>
  <li class="list-option" role="option" aria-selected="false" aria-disabled="true" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">print</span></li>
</ul></j3w1-list>

multi

  • FX-320 reflow
  • FX-ZOOM-200 text zoom
  • FX-RM reduced motion
  • FX-TOUCH pointer
Markup
<j3w1-list id="example-list-multi"><ul class="list" role="listbox" aria-label="Fixtures" aria-multiselectable="true">
  <li class="list-option" role="option" aria-selected="true" tabindex="0"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">FX-320 reflow</span></li>
  <li class="list-option list-option-demo-target" role="option" aria-selected="false" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">FX-ZOOM-200 text zoom</span></li>
  <li class="list-option" role="option" aria-selected="true" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">FX-RM reduced motion</span></li>
  <li class="list-option" role="option" aria-selected="false" aria-disabled="true" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">FX-TOUCH pointer</span></li>
</ul></j3w1-list>

with-meta

  • text-field14 states
  • tabs7 states
  • menu8 states
  • chartR2
Markup
<j3w1-list id="example-list-with-meta"><ul class="list" role="listbox" aria-label="Components">
  <li class="list-option" role="option" aria-selected="true" tabindex="0"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">text-field</span><span class="list-meta">14 states</span></li>
  <li class="list-option list-option-demo-target" role="option" aria-selected="false" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">tabs</span><span class="list-meta">7 states</span></li>
  <li class="list-option" role="option" aria-selected="false" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">menu</span><span class="list-meta">8 states</span></li>
  <li class="list-option" role="option" aria-selected="false" aria-disabled="true" tabindex="-1"><span class="list-check" aria-hidden="true">✓</span><span class="list-label">chart</span><span class="list-meta">R2</span></li>
</ul></j3w1-list>

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/list.css';
import '@j3w1/ui/register/list';

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 list --out ./vendor/j3w1/list

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

List list

  • Family: Information display
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Custom widget: APG listbox with roving tabindex; options carry aria-selected, the list aria-multiselectable when several may be chosen — APG pattern
  • specified
  • demonstrated

A selectable list of rows (an APG listbox) in single or multiple selection; the selected row is the selection fill with a check glyph and an optional metadata column.

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.controlapproveduse#c81a1aD-041 owner correction: red control and floating-frame borders, distinct from rose text.
row.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.
row.bg-hovercolor.interaction.hover.bgapproveduse#1c1010D-041 interaction.hover.bg: color.primitive.modern.hover.
row.dividercolor.border.dividerapproveduse#482b2bD-041 border.divider: color.primitive.modern.divider.
row.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
row.text-disabledcolor.text.disabledapproveduse#a3676bD-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.
selected.inactive-bgcolor.interaction.selection.inactive-bgobserveduse#420f0cSelection while the container is not focused.
selected.inactive-textcolor.interaction.selection.inactive-textapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
check.glyphcolor.interaction.selection.textobserveduse#f4eeeeText on the selection.
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.

State matrix

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

StateSingleMultiWith metadata
default
  • default
  • extended
  • high-contrast
  • print
  • FX-320 reflow
  • FX-ZOOM-200 text zoom
  • FX-RM reduced motion
  • FX-TOUCH pointer
  • text-field14 states
  • tabs7 states
  • menu8 states
  • chartR2
hover
focus-visible
selected
selected+focus-visible
selected+container-inactive
disabled

Purpose

Choose one or several rows from a short, visible set. It holds a selection and never navigates: rows that lead somewhere are sidebar-nav, rows with columns a table, a long set that needs filtering a combobox.

Anatomy

Parts as listed in the anatomy; on a selected row every part, metadata and ✓ included, takes color.interaction.selection.text.

States

StateVisualNon-colour channel
defaulttext color.text.default; no fill; check gutter empty—
hoverbackground → color.interaction.hover.bgcursor: pointer
focus-visible1px dashed color.interaction.focus.ring at −2px on the optionthe ring
selectedfill color.interaction.selection.bg; text and glyph color.interaction.selection.textaria-selected="true"; the ✓ glyph
selected+focus-visiblethe fill and 1px dashed color.interaction.focus.ring at −2pxboth visible at once
selected+container-inactivefill color.interaction.selection.inactive-bg with color.interaction.selection.inactive-text; no ringlightness drop between the two fills; the glyph stays
disabledtext color.text.disabled; no fill; no hover; still reachable by arrow keysaria-disabled="true"; cursor: not-allowed

Precedence: disabled > selected > hover; focus-visible is always drawn.

Keyboard

The list costs one tab stop (tabindex="0" on the selected or first option, -1 on the rest). Disabled options are reached and announced, never skipped.

Accessibility

aria-label or aria-labelledby names the listbox; every option carries aria-selected, including "false". The ✓ is aria-hidden; aria-selected is the state. Metadata sits inside the option so it is read with the label. Text meets 4.5:1; frame and rings 3:1. Rows are at least 24 CSS pixels tall, with the check gutter as the leading target area.

Portability

Rows with a background, a glyph gutter and an outline; nothing else. Native list views take the fill, inactive fill and divider colour and keep their own keyboard model. The inactive fill applies when the list’s window or pane loses focus; the web detects it with :focus-within on the pane.

Non-examples

A selected row marked by a border or check without the fill. Rounded row highlights. Muted metadata left on the selection fill. Every row a tab stop. Navigating on selection. Disabled rows removed from the arrow-key order. Hover that changes text colour. A frameless list on the canvas.

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
list default textdefaulttextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
list default borderdefaultuicolor.border.control #c81a1acolor.surface.default #0d07073.443pass
list hover texthovertextcolor.text.default #e99499color.interaction.hover.bg #1c10108.104.5pass
list focus-visible textfocus-visibletextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
list focus-visible outlinefocus-visibleuicolor.interaction.focus.ring #e53935color.surface.default #0d07074.733pass
list selected textselectedtextcolor.interaction.selection.text #f4eeeecolor.interaction.selection.bg #53131012.474.5pass
list selected+focus-visible textselected+focus-visibletextcolor.interaction.selection.text #f4eeeecolor.interaction.selection.bg #53131012.474.5pass
list selected+focus-visible outlineselected+focus-visibleuicolor.interaction.focus.ring #e53935color.interaction.selection.bg #5313103.383pass
list selected+container-inactive textselected+container-inactivetextcolor.interaction.selection.inactive-text #e99499color.interaction.selection.inactive-bg #420f0c7.024.5pass
metadata column on the list surface—textcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass
metadata column on the hover fillhovertextcolor.text.muted #d4868bcolor.interaction.hover.bg #1c10106.704.5pass
disabled option text (exempt; house floor 3:1)disableduicolor.text.disabled #a3676bcolor.surface.default #0d07074.483pass
row divider (decorative)—uicolor.border.divider #482b2bcolor.surface.default #0d07071.581pass

Keys

KeyAction
TabEnters the list at the selected option, or the first option when nothing is selected; a second Tab leaves the list.
Down / UpMoves focus to the next or previous option; in single selection the selection follows focus.
Home / EndMoves focus to the first or last option.
SpaceToggles the focused option in a multi-select list.
Shift+Down / Shift+UpExtends the selection by one in a multi-select list.
Ctrl+ASelects every option in a multi-select list.
A-ZMoves focus to the next option starting with the typed character.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: card select combobox tree table

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