Skip to content

createFormPlugin

createFormPlugin(config): FormPlugin

Defined in: packages/forms/src/plugin.ts:32

Create a form plugin that provides UI components for rendering auto-generated forms.

The plugin encapsulates all UI-specific rendering: one component per input type (textInput, numberInput, select, checkbox), a form wrapper, and a submit button. The headless core (introspectTable, createResolver) remains UI-agnostic; the plugin bridges it to a specific component library.

Configuration object containing the FormPluginComponents implementations.

FormPluginComponents

FormPlugin

A FormPlugin to pass to createAutoForm.

import { createFormPlugin, createAutoForm } from "@cfast/forms";
const plugin = createFormPlugin({
components: {
textInput: MyTextInput,
numberInput: MyNumberInput,
select: MySelect,
checkbox: MyCheckbox,
form: MyFormWrapper,
submitButton: MySubmitButton,
},
});
export const AutoForm = createAutoForm(plugin);