Build Custom Form Fields
Customize your forms with your own components written in React.
Last updated
Was this helpful?
Customize your forms with your own components written in React.
Last updated
Was this helpful?
Within your white label admin account, go to your account settings, and then click the Custom Fields
tab. Specify the following information
Custom Field Name: user-friendly label for your custom field
Custom Field Type: internal, unique identifier for your custom field type
Custom Field Icon: URL to icon (preferably SVG) to use in the form designer for your custom field
Custom Field code: React component code to render your custom field
Your admin account and workspaces will subsequently have access to the custom field element that they can drag onto and use within their forms.
Your custom component must follow these requirements to work properly:
Must be exported as the default export
Must accept and handle value
and onChange
props
Must be a valid React component
Your component will receive these props:
value
: The current value of the field. Can be a valid json value or object
onChange
: Function to update the field's value
Accepts one parameter: the new value
Updates the form state automatically
You can import and use npm packages in your custom component. Here's a more complex example using the react library react-colorful
Please note the following limitations:
Style properties inside the designer are not currently supported
Component must be self-contained in a single file
Component cannot use Typescript
These limitations will be updated in the near future.