sveltelean
Version v0.18.0

Policy

  • Native semantics first. No added role where a native element has the widget model; otherwise the WAI-ARIA Authoring Practices pattern.
  • Correctness before bytes. Order: correctness, accessibility, developer experience, performance, bundle size.
  • Behavior, not attributes. Tests press ArrowRight and check focus moved.
  • Authored ids. Server markup is correct before hydration and identical after.
  • axe and keyboard tests are not screen-reader testing; the site says which it has.

The contract

Every primitive ships a contract.md with the same sections, read here from the tabs contract at build time:

  1. Required semantics
  2. Required parts
  3. Options
  4. Application-rendered panel
  5. Native part
  6. Looks
  7. Keyboard interaction
  8. Focus rules
  9. Disabled behavior
  10. Orientation
  11. RTL
  12. ARIA relationships
  13. Events
  14. Platform features and Baseline
  15. Attribute helper
  16. SSR expectations
  17. JS-disabled behavior
  18. Runtime budget
  19. Test cases

50 contracts, linked from each primitive page. Native ones also name their platform features, Baseline status and fallback (Browser support).

Focus and portal policy

No universal focus manager; each primitive has its own focus contract:

  • Dialog: native showModal(); the rest is inert, closing returns focus to the invoker.
  • Tabs: roving tabindex.
  • Menu: first enabled item on open, the invoker on close.
  • Combobox: focus stays in the input; aria-activedescendant marks the option.

No portal, overlay manager or z-index context: the top layer does it. Positioning: implicit anchor, then CSS anchor positioning, then the CSS fallback; no JavaScript positioning engine.

Regression budget

A behavior change runs the contract's test cases in a real browser in the same gate as the size budgets. A byte saved never outweighs a failing keyboard test.

Test layers

LayerWhat it provesWhere
Contract testsTier, routed events, registration module and native base of every primitivepackages/primitives/tests/registry.test.ts
Algorithm testsNext and previous enabled item, Home and End, RTL, typeahead matchingpackages/core/tests, packages/primitives/tests/tabs.test.ts, menu.test.ts
Browser interaction testsFocus, dialog, popover, top layer and anchor positioning in a real browserapps/playground/tests/primitives/native.spec.ts, tabs.spec.ts, menu.spec.ts
Keyboard contract testsArrow keys, Home and End, activation modes, disabled skipping, Escape and focus returnapps/playground/tests/primitives/tabs.spec.ts, menu.spec.ts, table/table.spec.ts
JavaScript-disabled testsThe native contracts with page JavaScript offapps/playground/tests/primitives/native.spec.ts
SSR testsServer HTML with authored state and ids; hydration changes nothingapps/playground/tests/ssr.spec.ts, packages/*/tests/ssr.test.ts
Automated accessibility scansNo serious or critical axe violation on every page and on open dialog, popover and menu statesapps/playground/tests/primitives/a11y.spec.ts, apps/docs/tests/routes.spec.ts
Production bundle testsThe shipping invariants against real production outputfixtures/*, apps/playground/tests/bundle.spec.ts

Focus, top layer and anchor positioning run in Playwright; happy-dom unit tests cover the algorithms only.

Test matrix

From the claim registry and the audit of 2026-09-27. "Not run": no recorded run (Firefox and WebKit run nightly, not on pull requests). "Not done": no session recorded.

AreaChromiumFirefoxWebKitScreen reader
Keyboardtested in Chromiumnot runnot runnot done
Focustested in Chromiumnot runnot runnot done
axe scantested in Chromiumnot runnot runn/a
RTLtested in Chromium (tabs)not runnot runnot done
Without JavaScripttested in Chromiumnot runnot runn/a
Reduced motionstylesheet rule; no browser testnot runnot runn/a
Forced colorsstylesheet rule; no browser testnot runnot runn/a
Screen reader smokenot donenot donenot donenot done

Recorded Firefox and WebKit runs are a stage 2 requirement, a screen-reader session per primitive (VoiceOver with Safari, NVDA with Chrome or Firefox) stage 3 (docs/release.md).

What is not claimed

  • Screen-reader behavior, in any browser.
  • Behavior in Firefox or WebKit on every pull request: the playground suite runs there in the nightly cross-browser job (SLEAN_BROWSERS=all), not in the pull-request job.
  • IME composition with an operating-system input method: the autocomplete and the select search are tested through the DevTools protocol only.

Source