Mixins / Authoring components
Choose the right rung before building
Start at the highest rung that solves your problem:
| Rung | When to use it | What you write |
|---|---|---|
| 1. Shipped widget | foldkit-mixins-ui has it | Options, Messages, recipe variant |
| 2. Customized widget | Widget fits except a style or key | Recipes.X.extend, mixins, routes, words |
| 3. App component | Unique to this app | Slots, SlotView, primitives, Style |
| 4. Reusable widget | Shared across apps | Rung 3 + catalog recipe and A11y.pattern |
| 5. Primitive | Reusable interaction pattern | Bundle, Mount, and/or Behavior |
The pieces you assemble on rungs 3–5 fit together as data: a Slots contract names the elements (root, list, chip); SlotView renders markup through slots.<name>.attrs(...); Style and Recipe attach theme-token CSS across cascade layers; Behavior attaches computed attributes and mounts; and Bundle packages child state (Model, Message, update, helpers).