Mixins / foldkit-mixins-surface

foldkit-mixins-surface

Connects a foldkit-surface feature boundary to a foldkit-mixins SlotView without repeating that boundary in the view layer.

The two packages answer different questions:

Surface   -> what may this feature observe and which Messages may it emit?
SlotView  -> where may this view be customized with Style and Behavior?

SurfaceView.define joins them. The SlotView's input becomes exactly the Surface's projected value, and its Message universe becomes exactly the Surface's exposed subset. A Behavior cannot quietly read a root-Model field the Surface omitted or emit a Message the feature did not expose; both mistakes are type errors where the view is defined.

The bridge creates no state, no renderer, and no second runtime. The result is an ordinary SlotView with the Surface's boundary reflected in its types.

Use it when

You already render a Surface and want to style or decorate that feature through typed Mixins extension points. If you are not using foldkit-surface, use SlotView.define / SlotView.forMessages from foldkit-mixins directly — this package adds nothing else.

For the Mixins mental model itself (Slot, Style, Behavior, SlotView), read Inside-out view composition first.

Install

bash
pnpm add foldkit-mixins foldkit-surface foldkit-mixins-surface

foldkit, effect, foldkit-mixins, and foldkit-surface are peer dependencies.