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

Multiple selection

A searchable native checkbox group that preserves all selected form values.

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

Live variants

default

Notification topics

3 topics; 1 selected

Markup
<j3w1-multiselect id="example-multiselect-default"><fieldset class="multiselect checkbox checkbox-group"><legend class="checkbox-legend">Notification topics</legend><label for="example-multiselect-default-multiselect-search">Filter topics</label><input class="multiselect-control" id="example-multiselect-default-multiselect-search" type="search" data-filter="" data-demo-focus-target=""><button class="multiselect-control" type="button" data-clear-selection="">Clear selection</button><div data-options=""><label class="checkbox-option"><span class="checkbox-control"><input class="checkbox-input" type="checkbox" name="example-multiselect-default-topics" value="releases" checked=""><svg class="checkbox-check" aria-hidden="true" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3.5 8.5l3 3 6-6"></path></svg></span><span class="checkbox-text">Releases</span></label><label class="checkbox-option"><span class="checkbox-control"><input class="checkbox-input" type="checkbox" name="example-multiselect-default-topics" value="components"><svg class="checkbox-check" aria-hidden="true" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3.5 8.5l3 3 6-6"></path></svg></span><span class="checkbox-text">Components</span></label><label class="checkbox-option"><span class="checkbox-control"><input class="checkbox-input" type="checkbox" name="example-multiselect-default-topics" value="guides"><svg class="checkbox-check" aria-hidden="true" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3.5 8.5l3 3 6-6"></path></svg></span><span class="checkbox-text">Guides</span></label></div><p role="status" data-selection-status="">3 topics; 1 selected</p></fieldset></j3w1-multiselect>

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

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

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.
valuesstring[]Selected native checkbox values, including hidden matches.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.
clear(): voidClear every selected value and report the explicit change.

events

NameType / signatureMeaning
j3w1-selectionCustomEventThe selected values changed through interaction.

Dependencies and verification

Registered components: none. Style dependencies: checkbox.

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

Multiple selection multiselect

  • Family: Advanced forms
  • Maturity: stable
  • Priority: R2
  • Since: 1.0.0
  • Native control: Fieldset, legend, search input and native checkboxes
  • specified
  • demonstrated

A searchable native checkbox group that preserves all selected form values.

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.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.
root.bordercolor.border.controlapproveduse#c81a1aD-041 owner correction: red control and floating-frame borders, distinct from rose text.
heading.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.
secondary.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.
control.bgcolor.surface.inputapproveduse#000000Form-control fill.
control.focuscolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
button.bgcolor.action.secondary.bgobservedusergb(0 0 0 / 0%)Secondary button has no fill.
button.textcolor.action.secondary.textapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
button.bordercolor.action.secondary.borderapproveduse#986f72D-041 action.secondary.border: color.primitive.modern.control.
button.bg-hovercolor.action.secondary.hover-bgobserveduse#630f0dSecondary button hover.
button.bg-activecolor.action.secondary.pressed-bgobserveduse#420f0cSecondary button pressed.
button.border-activecolor.border.activeobserveduse#e53935Active or focused control border.
button.focuscolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
dependency.role-border-width-defaultborder.width.defaultobserveduse1pxEvery border is 1px.
dependency.role-border-width-emphasisborder.width.emphasisobserveduse2pxSelected indicator, sticky header rule, invalid border.
dependency.role-color-action-primary-bgcolor.action.primary.bgapproveduse#7d1310Primary button fill; D-026 darkened it off color12, which stays fixed as heritage ANSI 12.
dependency.role-color-action-primary-hover-bgcolor.action.primary.hover-bgobserveduse#911410Primary button hover; pair with action.primary.text (D-033).
dependency.role-color-action-primary-textcolor.action.primary.textapproveduse#ffa2a7Primary action labels: bright rose across rest, hover and pressed states (D-033).
dependency.role-color-border-activecolor.border.activeobserveduse#e53935Active or focused control border.
dependency.role-color-border-disabledcolor.border.disabledapproveduse#482b2bD-041 border.disabled: color.primitive.modern.divider.
dependency.role-color-interaction-disabled-bgcolor.interaction.disabled.bgapproveduse#0d0707D-041 interaction.disabled.bg: color.primitive.modern.panel.
dependency.role-color-interaction-focus-ring-containercolor.interaction.focus.ring-containerobserveduse#ffa2a7Focus colour for containers and explicitly mapped filled controls (D-015); component rules determine ring geometry.
dependency.role-color-interaction-hover-bgcolor.interaction.hover.bgapproveduse#1c1010D-041 interaction.hover.bg: color.primitive.modern.hover.
dependency.role-color-status-danger-bordercolor.status.danger.borderobserveduse#e53935Danger border, 2px on invalid inputs.
dependency.role-color-status-danger-textcolor.status.danger.textobserveduse#f07178D-041 readable error text on neutral surfaces and native warning tints.
dependency.role-color-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.
dependency.role-density-comfortable-control-heightdensity.comfortable.control-heightobserveduse32px
dependency.role-density-compact-control-heightdensity.compact.control-heightobserveduse24px
dependency.role-focus-offsetfocus.offsetobserveduse-2pxoutline-offset for controls.
dependency.role-focus-ringfocus.ringobserveduse1px dashed #e53935outline on controls and rows.
dependency.role-font-line-height-ui-mdfont.line-height.ui-mdobserveduse18px
dependency.role-font-line-height-ui-smfont.line-height.ui-smobserveduse16px
dependency.role-font-size-ui-mdfont.size.ui-mdobserveduse13px
dependency.role-font-size-ui-smfont.size.ui-smobserveduse12px
dependency.role-icon-size-mdicon.size.mdobserveduse16px
dependency.role-radius-noneradius.noneobserveduse0pxThe only radius. Nothing is rounded.
dependency.role-space-12space.12observeduse12px
dependency.role-space-2space.2observeduse2px
dependency.role-space-24space.24observeduse24px
dependency.role-space-4space.4observeduse4px
dependency.role-space-8space.8observeduse8px

State matrix

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

StateDefault
default
Notification topics

3 topics; 1 selected

checked
focus-visible
disabled
no-results

Purpose

Select zero or more named values from a searchable native checkbox list.

Anatomy

Parts as listed in the anatomy.

States

StateVisualNon-colour channel
defaultNamed content on the default surface. Button controls are the secondary button (button.md); inputs keep the input look.Native text and structure.
checkedSelected fill and a check indicator.Native checked state.
focus-visibleDashed focus ring.Native keyboard focus position.
disabledDisabled semantic foreground, background and border at full opacity.Native disabled state blocks activation.
no-resultsMuted result count.Zero-results text; selected values stay selected.

Keyboard

As in the key table.

Accessibility

Keep labels and native checkbox semantics. Filtered-out choices leave the focus order but keep their checked form values. Announce matching and selected counts, including zero. Required-selection policy belongs to the host; marking every checkbox required would require every option.

Portability

Follows the shared component defaults in spec/portability.md (section “Shared component defaults”).

Non-examples

Unlabelled controls, color-only status, drag-only operations, hidden required instructions, stolen focus or an invented service success.

Contrast report

7 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
multiselect default textdefaulttextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
multiselect default borderdefaultuicolor.border.control #c81a1acolor.surface.default #0d07073.443pass
Primary content—textcolor.text.default #e99499color.surface.default #0d07078.724.5pass
Supporting content—textcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass
Control boundary—uicolor.border.control #c81a1acolor.surface.default #0d07073.443pass
Button label—textcolor.action.secondary.text #ffa2a7color.surface.default #0d070710.454.5pass
Button label on hover—textcolor.action.secondary.text #ffa2a7color.action.secondary.hover-bg #630f0d6.844.5pass

Keys

KeyAction
Tab / Shift+TabVisit search, clear and each visible enabled checkbox.
SpaceToggle the focused checkbox.
EscapeClear a non-empty query without clearing selection.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

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