CrudForm API
API reference docs for the React CrudForm component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { CrudForm } from '@toolpad/core/Crud';| Name | Type | Default | Description |
|---|---|---|---|
| formState* | { errors: object, values: object } | - | Form state object, including field values and errors. |
| onFieldChange* | func | - | Callback fired when a form field is changed. |
| onSubmit* | func | - | Callback fired when the form is submitted. |
| submitButtonLabel* | string | - | Text for form submit button. |
| dataSource | object | - | Server-side data source. |
| onReset | func | - | Callback fired when the form is reset. |
| slotProps | { checkbox?: object, datePicker?: object, dateTimePicker?: object, select?: object, textField?: object } | {} | The props used for each slot inside. |
| slots | { checkbox?: elementType, datePicker?: elementType, dateTimePicker?: elementType, select?: elementType, textField?: elementType } | {} | The components used for each slot inside. See Slots API below for more details. |
The component cannot hold a ref.
| Slot name | Class name | Default component | Description |
|---|---|---|---|
| textField | TextField | The text field component used in the form. | |
| checkbox | TextField | The checkbox component used in the form. | |
| datePicker | DatePicker | The date picker component used in the form. | |
| dateTimePicker | DatePicker | The date and time picker component used in the form. | |
| select | Select | The select component used in the form. |
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.