Contributing

Start from a concrete interaction: identify the corresponding W3C pattern, describe the expected keyboard and pointer behavior, and reproduce the problem in a small example. Keep native HTML behavior wherever possible.

Set up and verify a change

npm ci
npx playwright install chromium firefox webkit
npm run demos:generate
npm test
npm run build

On Linux, Playwright's browser dependencies may require npx playwright install --with-deps. During development, run npm run dev and target the relevant test file, for example:

npx playwright test tests/menus.spec.js --project=chromium
npm run test:unit
npm run test:a11y

npm test runs the initialization unit test and the Playwright suite across Chromium, Firefox, and WebKit. Accessibility tests use axe without disabling its rules. Add checks for the feature's real behavior: focus movement, activation, state and relationship updates, disabled controls, and dynamic content. For native controls, preserve form and editing behavior.

Find the implementation

Follow the component contract

A registered module exposes static selector, static matches(element), and static init(element). Validate any required element type or role, then call super.init(element) and return early when it returns false. The guard tracks each concrete component class on each element, so listeners are attached only once.

import { AxxyComponent } from '../axxy-component.js';
import { axxyRegistry } from '../axxy-registry.js';

export class AxxyExample extends AxxyComponent {
  static selector = '[role="example"]';

  static matches(element) {
    return element.getAttribute('role') === 'example';
  }

  static init(element) {
    if (!super.init(element)) return false;
    // Attach this behavior's event listeners once.
    return true;
  }

  static refresh(element) {
    // Reconcile the current children, relationships, and focus state.
  }
}

axxyRegistry.example = AxxyExample;

This skeleton registers the example pattern. Implement its behavior in the module and import it from the full entry point. The optional refresh(element) method can run repeatedly after initialization: keep it idempotent, avoid duplicating listeners, and preserve author-supplied IDs, names, and user state. Composite widgets should respect nested widget boundaries and refresh their focus model when children change.

Update documentation and examples at their source

Example markup and setup functions live in demos/definitions/*.js; demos/catalog.json supplies titles, categories, and W3C source links. Keep these modules safe to import in Node: browser work belongs inside setup(root). Site prose is authored in documentation definition modules such as demos/documentation.js.

Edit those sources, then run npm run demos:generate. scripts/generate-demos.mjs writes the route HTML and coverage records; direct edits to generated pages will be overwritten. demos/page.js initializes examples in the browser, and demos/site.css styles the shared site.

Before submitting, describe the changed behavior and the checks you ran. Use the linked W3C example to review keyboard expectations, and verify critical paths with a screen reader. Automated checks do not confirm announcement quality or every browser and assistive-technology combination.