Mixins / Authoring components

Checklist for reusable widgets and primitives

When turning a custom component into a reusable widget (foldkit-mixins-ui) or shared interaction (foldkit-primitives), verify:

  • Explicit Slots and Pattern: Every customizable element is a Slot with protected structural roles (role), an A11y.pattern, and A11y.conform or catalog support coverage.
  • Consistent options: Support id prefixing, label, NoInfer<Message> callbacks, disabled via aria-disabled (refusing in update), words, direction ('rtl' arrow swapping), routes, style, mixins, and name for form controls.
  • State and timing: Stateful widgets export Model, Message, init, update, and onMessage; primitives run timers on Effect's clock and report settled results as OutMessage.
  • Tests that can fail: Include unit tests for update identity and timing (TestClock), .test-d.ts negative type checks, browser tests for focus/keys/computed style/conformance, and SSR HTML assertions.