Stable atomic slots
Status: Accepted
Provenance: L163 made this decision on 2026-11-18 for #530, filed by woksin.
Context
Section titled “Context”ADR 0004 made nine presentation slots stable and
kept the five atomic slots (datatables.paginator, dialogs.dialog, dropdown.select,
display.datePicker, common.tooltip) behind the unstable_ generic manifest. An adapter that
must own one of those interactions, such as a design-system paginator, had no stable way to do so.
ADR 0004 also rules that adding a slot to stable-presentation/v1 is not a compatible expansion.
The MUI, PrimeReact 11, and PrimeReact 10 adapters must keep resolving exactly as they do today.
Decision
Section titled “Decision”Stable atomic slots are a separate, optional extension of CratisPresentationUiLibrary:
cratisAtomicSlotIdslists the atomic slots whose contracts are stable. The first release listed onlydatatables.paginator;common.tooltip,dropdown.select, anddisplay.datePickerwere appended next, thendialogs.dialogandcommon.numberInput. New ids are only ever appended.CratisAtomicSlotsmaps each id to its exact public props type,CratisAtomicSlotDeclarationrequiresatomicmode,nativeoremulatedfidelity, and a component, andCratisAtomicSlotMapmakes every entry optional. Amended by ADR 0008: thedialogs.dialogcontract is the publicDialogPropsplus a Components-ownedhostprop, because the dialog shares its stack, result flow and overlay container with Components.CratisPresentationUiLibrary.atomicSlotsis optional.profileSlotsandslotskeep meaning the nine presentation slots, so no existing manifest, validator, or adapter changes.definePresentationUiLibrary()validates and freezesatomicSlotswhen it is present and leaves the field out of the result when it is absent. It reads one snapshot of the map’s own enumerable keys, rejects unknown ids and inherited declarations, and ignores non-enumerable ones.- Resolution applies the same checks to libraries that claim the stable profile through the generic definer or a raw manifest. An invalid atomic declaration is not resolved, so the control keeps its built-in implementation, and library validation reports it as a diagnostic.
- Resolution merges the stable atomic declarations of a
stable-presentation/v1library into the slot table that the renderer layer and manifest composition already build. A library withoutatomicSlots, or of any other profile, contributes nothing, so its table is unchanged. An omitted atomic slot keeps the built-in Components implementation. @cratis/components.conformanceruns the existing slot profile for every declared stable atomic slot, and package metadata lists those slots and theiratomicmode alongside the nine.
The profile identifier stable-presentation/v1 and renderer ABI major 1 stay unchanged. No new
profile id is introduced, because no existing adapter acquires a requirement: the field is optional
and each atomic slot is independently optional.
Semver policy
Section titled “Semver policy”Removing an id from cratisAtomicSlotIds, changing its identifier, changing its public component
props or ref contract, changing its atomic behavior ownership, or weakening its required fidelity
is a breaking change.
Appending an id to cratisAtomicSlotIds is a compatible addition, because the map entry is
optional and an adapter that omits it keeps the built-in implementation.
Consequences
Section titled “Consequences”An adapter that implements a stable atomic slot owns the whole interaction for that control:
keyboard, focus, and callbacks. Adapters that do not declare atomicSlots keep the built-in
paginator, dialog, dropdown, date picker, and tooltip. The unstable_ generic manifest and its
atomic slots keep working as before; the stable names are new symbols alongside them.