Form component
Installing and using custom form components
Kissflow lets you build a fully custom UI for dataform, board, and process forms using the useForm React hook. It drives Kissflow's validation, permissions, dynamic field state, and persistence for you — including child tables — from a single dynamic configuration.
1. Creating a new custom form component
If you're starting a project from scratch, you can create a Kissflow custom form component package using npm
npx @kissflow/create-component@latestYou will be prompted to provide a name for your component and choose form.
Note
You can also scaffold non-interactively (for example, in CI) with npx @kissflow/create-component@latest --target form --name my-form --yes.
Note
This scaffolds a Vite/React app pre-wired with a useForm hook, a reference form implementation (src/form/), and field components for every Kissflow field type.
Once installed, run the following commands:
cd componentname
npm install
npm run devOnce development is done, you can use the npm run zip command to build and compress the project into a zip file. You can then import this zip file directly into Kissflow as a custom Form component.
Note
Prerequisite: Node.js version 18.14.1 and above.
Using the useForm hook
import { useForm } from "./hooks/useForm";
const { formData, config, updateField, isSaving, errors } = useForm({
flowType: "dataform",
flowId: "EmpMaster",
instanceId: "emp_123" // omit to create a new record
});Parameters
useForm takes a single options object.
| Parameter | Type | Required | Description |
|---|---|---|---|
| flowType | String | Yes | "dataform", "board", or "process". |
| flowId | String | Yes | Id of the dataform, board, or process. |
| instanceId | String | No | Record instance Id to load. Omit to create a new record. |
| viewId | String | No | Dataform/board only. The view whose layout and permissions to apply. |
| activityInstanceId | String | No | Process only. The activity (task) instance the form is being filled for. |
Returns
useForm returns an object with the following properties:
| Property | Type | Description |
|---|---|---|
| formData | Object | Current values keyed by field Id. Child-table rows live at formData[tableId]. |
| config | Object | Form configuration — { formPermission, sections }. |
| errors | Object | Validation errors, nested by section/table/row. |
| loading | Boolean | True during initial load and while runAction() is in flight. |
| error | String | null | General error message if an operation failed. |
| isSaving | Boolean | True while an updateField/updateFields autosave request is in flight. |
| isNewRecord | Boolean | True when no instanceId was provided. |
| updateField(fieldId, value) | Function | Validates, autosaves, and refreshes field state. Returns Promise<boolean>. |
| updateFields(updates) | Function | Batch autosave of { fieldId: value }. Returns Promise<boolean>. |
| getField(fieldId) | Function | Returns Promise<object> with the full details of one field. |
| getFieldOptions(fieldId, tableId?, rowId?) | Function | Returns Promise<object[]> of dropdown/select options. Pass tableId/rowId for a table cell. |
| getFormData() | Function | Returns Promise<object> with the latest data straight from the form store. |
| parseAttachment(fieldId, file) | Function | Process only. Runs AI Smart Attachment parsing; returns Promise<{ appliedFields, suggestedBy }>. |
| runAction(action, extra?) | Function | Single dispatcher for every lifecycle action (submit/discard/reject/etc), resolved from flowType. Returns Promise<boolean>. |
| getTable(tableId) | Function | Returns child-table operations: addRow, addRows, updateRow, deleteRow, deleteRows, getRowField, getSelectedRows. |
| processStatus | String | Process only. The item's current status (Draft, InProgress, Completed, …). |
| isStartStep | Boolean | Process only. True when the current activity is the process's start step. |
| formActions | Object[] | Process only. Ordered workflow-action descriptors for the current step. Empty array for dataform/board. |
| getReassignees(query?) | Function | Process only. Returns Promise<object[]> of candidate assignees for the Reassign action. |
Note
This page covers the useForm hook's inputs and outputs. For the full guide — the config object shape, saving vs submitting, child tables, validation error handling, actions, and troubleshooting — see the README.md generated inside your scaffolded project, or the reference implementation at src/form/index.jsx.

