FormComponents
Allows you to define custom form components for custom fields in the dashboard.
id
stringA unique identifier for the custom form component. It is a good practice to namespace
these IDs to avoid naming collisions, for example "my-plugin.markdown-editor".
component
DashboardFormComponentThe React component that will be rendered as the custom form input.
Interface for registering custom field components in the dashboard. For input and display components, use the co-located approach with detailForms.
customFields
DashboardCustomFormComponent[]Custom form components for custom fields. These are used when rendering custom fields in forms.
Props that get passed to all form input components. They are based on the
controller props used by the underlying react-hook-form, i.e.:
in addition, they can optionally be passed a fieldDef prop if the
component is used in the context of a custom field or configurable operation arg.
The fieldDef arg, when present, has the following shape:
Metadata which can be defined on a DashboardFormComponent which provides additional information about how the dashboard should render the component.
The metadata is defined by adding the static property on the component:
Example
isListInput
boolean | 'dynamic'Defines whether this form component is designed to handle list inputs.
If set to 'dynamic', it means the component has internal logic that can
handle both lists and single values.
isFullWidth
booleanTODO: not currently implemented
This is the common type for all custom form components registered for:
- custom fields
- configurable operation args
- detail page fields
Here's a simple example: