Form / foldkit-mixins-form
Render controls with foldkit-mixins-ui
Install foldkit-mixins-ui and @foldkit/ui, then pass UiForm.renderers(styles?) from foldkit-mixins-form/ui to swap plain HTML controls for foldkit-mixins-ui widgets:
import * as UiForm from 'foldkit-mixins-form/ui'
import { InputSlots, Recipes, SelectSlots } from 'foldkit-mixins-ui'
const UiView = FormView.define(Edit, {
renderers: UiForm.renderers({
input: Style.forSlots(InputSlots)(Recipes.Input()),
select: Style.forSlots(SelectSlots)(Recipes.Select()),
}),
})Each key in renderers (input, textarea, select, checkbox, checkboxGroup) is optional. The form keeps ownership of labels, descriptions, checking indicators, error alerts, IDs, and ARIA attributes while swapping the inner control element. Note that Text, Number, Multiline, and select styles move from FieldSlots onto the UI component Slots, and Toggle/Choices/RelationMany render role="checkbox" buttons paired with hidden inputs for progressive enhancement.
Customize field layouts with UI inputs
UiForm.field({ toMessage, inputStyle, textareaStyle?, draw?, words? }) builds a per-key FormView.fields override for Text and Multiline controls while preserving labels, required state, descriptions, and validation alerts. Passing draw hands your layout function { label, control, description, field } and h; omitting draw stacks them inside a FieldSlots root. Unsupported control kinds throw immediately, so keep non-text fields on the default renderer. Submit buttons in custom layouts use Button.view from foldkit-mixins-ui while foldkit-mixins-form keeps submit handling and aria-disabled state.