Form field is a wrapper for any input that's part of a form.
Required form fields must have isRequired prop set to true.
This adds a red asterisk near the label.
Normally form fields don't need to be marked as optional, but in Formkit forms usually all fields are required and few are not. In that context, it may be useful to explicitly mark field as optional, which adds a small badge near the label.
Set error message via error prop to mark the field as invalid and show that message below the input.
Inherits margin props.
| Name | Default | Description |
|---|---|---|
isRequired | — | booleanDetermines if this field is required. |
isOptional | false | booleanIndicates if this field is optional. |
label | — | ReactNodeField label. |
badge | — | ReactNodeBadge to display near the label. |
description | — | ReactNodeExtended description of the field. |
rightContent | — | ReactNodeContent to display on the right side of the field. Appears inline with the label. |
error | — | stringError message when this field's input is invalid. |
children | — | ReactNodeField input. |
tip | — | stringInstructions for the input value. |