Form
A container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons, etc. There should never be more than one per placement.
Component render
<img alt="Screenshot of the form Dashboard Add-Ons UI component" src="../assets/component-form.png"
<Form onSubmit={onSubmit} isDirty={isDirty}>
<Field>
<Input
value={value}
type="string"
required={true}
name="input"
label="Input"
onChange={onChange}
>
<Text>
Label
</Text>
</Input>
</Field>
</Form>
Properties
Property | Type | Description |
---|---|---|
onSubmit | function | An optional onSubmit attribute to be executed on form submission. Any rejected promises or errors thrown result in submission errors to the user. Native form submission is prevented and not supported. |
isDirty | boolean | A flag dictating the dirty state of the form. This enables contextual save buttons on the backing page. Defaults to false. |