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
protectedstructural roles (role), anA11y.pattern, andA11y.conformor catalogsupportcoverage. - Consistent options: Support
idprefixing,label,NoInfer<Message>callbacks,disabledviaaria-disabled(refusing inupdate),words,direction('rtl'arrow swapping),routes,style,mixins, andnamefor form controls. - State and timing: Stateful widgets export
Model,Message,init,update, andonMessage; primitives run timers on Effect's clock and report settled results asOutMessage. - Tests that can fail: Include unit tests for
updateidentity and timing (TestClock),.test-d.tsnegative type checks, browser tests for focus/keys/computed style/conformance, and SSR HTML assertions.