Mixins / foldkit-mixins
foldkit-mixins
Typed extension points for Foldkit views.
A component eventually gets used somewhere its author did not anticipate. One caller wants a
brand treatment, another wants a tooltip, another wants analytics, another needs an ARIA
attribute or a ResizeObserver. The usual answers are to keep adding props or to copy the
component and edit its markup.
foldkit-mixins takes a different approach:
A view declares where it may be customized once. Callers attach appearance and element-level behavior to those named points later.
The view keeps its markup, state and Messages. The caller gets a typed customization surface instead of an open-ended bag of props.
Without a slot contract With a slot contract
Button Button
├─ className ├─ root slot
├─ iconClassName ├─ icon slot
├─ tooltip └─ label slot
├─ tracking
├─ ariaLabelOverride callers attach independently:
├─ onFocusDecoration ├─ BrandStyle
└─ ... ├─ TooltipBehavior
└─ AnalyticsBehaviorThis is not a second component system and it is not a state library. A slot ultimately resolves to ordinary Foldkit attributes.