---
url: "https://vueda.dev/v3/reference/api/js/utils/buildForm/functions/buildForm.md"
title: "buildForm"
---

# buildForm

## Overview

Builds the form configuration by setting up state management for fields, components, and widgets.

## Signature

`buildForm(props, state, getFieldComponent, getFieldProps, getWidgetComponent, getWidgetProps)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-props">props</span> | `object` | yes | The reactive props object containing form metadata. |
| <span id="param-state">state</span> | `object` | yes | The target reactive object to manage for form state. |
| <span id="param-getFieldComponent">getFieldComponent</span> | `(field: FieldInfo) => Component` | yes | Function to retrieve the component for a given field. |
| <span id="param-getFieldProps">getFieldProps</span> | `(field: FieldInfo) => any` | yes | Function to retrieve field-specific properties. |
| <span id="param-getWidgetComponent">getWidgetComponent</span> | `(field: FieldInfo) => Component` | yes | Function to retrieve the widget for a given field. |
| <span id="param-getWidgetProps">getWidgetProps</span> | `(field: FieldInfo) => any` | yes | Function to retrieve widget-specific properties. |

#### props Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-props-app">app</span> | `string` |  |  | The app label. |
| <span id="param-props-model">model</span> | `string` |  |  | The model name. |
| <span id="param-props-view">view</span> | `string` |  |  | The view name. |

#### state Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-state-fieldDetails">fieldDetails</span> | `object` |  |  | Details of each field by name. |
| <span id="param-state-fields">fields</span> | `string[]` |  |  | The list of field names. |

### Returns

[BuildForm](/v3/reference/api/js/utils/buildForm/types/BuildForm.md)

Functions for managing form configuration and updating reactive state.

## Source

`client/lib/utils/buildForm.js:118`
