Form field

Also known as

Form input, Input control, Form element
Available since
@salt-ds/core@1.8.0

FormField is a wrapper for user interface controls that are typically found in a form (for example, Input, ComboBox or RadioButton). You must make these controls accessible by providing them with a visible label, validation control, states and descriptive text elements.

  • We highly recommend using the FormFieldLabel and FormFieldHelperText components within the form field to provide your form elements with the descriptive label and validation feedback required to ensure ADA compliance.
  • Align the form field to the correct Salt layout grid for your density and viewport size. Set the width of the form control to the number of columns that best reflects the length of the control’s expected value. You can set the form control width independently of the form field label and form field helper text if required.
  • Use a form field as a wrapper for editable components in a form layout—such as a simple form, filter panel or cash ticket.

Follow the Salt forms pattern for guidance using form fields in forms.

To import FormField and related components from the core Salt package, use:

NameTypeDescriptionDefault
NameTypeDescriptionDefault
NameTypeDescriptionDefault