Specifies the input type for appropriate message spacing. Used with checkbox-list or radio-group.
version
GoabFormItemVersionType 1 | 2
Design system version for styling.
Defaults to 1.
mt, mr, mb, ml
Spacing
Apply margin to the top, right, bottom, and/or left of the component.
ReactNode
error
ReactNode
Error text displayed under the form field. Leave blank to indicate a valid field. Accepts a string or ReactNode for custom error content.
helpText
ReactNode
Help text displayed under the form field to provide additional explanation. Accepts a string or ReactNode for custom help content.
error
TemplateRef
Error text displayed under the form field. Leave blank to indicate a valid field. Accepts a string or ngTemplate for custom error content.
helpText
TemplateRef
Help text displayed under the form field to provide additional explanation. Accepts a string or ngTemplate for custom help content.
error
slot
Error text displayed under the form field. Leave blank to indicate a valid field. Accepts a string or ReactNode for custom error content.
helptext
slot
Help text displayed under the form field to provide additional explanation. Accepts a string or ReactNode for custom help content.
Examples
Add a record using a drawer
Add and edit lots of filters
Add another item in a modal
Ask a long answer question with a maximum word count
Ask a user for a birthday
The date picker component handles accessibility automatically.
Ensure the form-item label clearly describes what date is being requested.
Ask a user for an address
Ask a user for an Indian registration number
Ask a user for direct deposit information
Ask a user for dollar amounts
Confirm a change
Disabled button with a required field
Dynamically add an item to a dropdown list
Dynamically change items in a dropdown list
Filter a list using a push drawer
Filter data in a table
Include a link in the helper text of an option
Include descriptions for items in a checkbox list
Question page
More info
Reset date picker field
Reveal input based on a selection
Review and action
Search
Select one or more from a list of options
Set a max width on a long radio item
Slotted error text in a form item
Slotted helper text in a form item
Type to create a new filter
Other
The form item automatically associates the label with the input for screen readers, ensuring your form is accessible.
Do
Use a form item wrapper on all inputs to add a label, helper text, error message, and more.
Sizing
Tip
Use labelSize='large' when you want the question to act as the heading on the page. This is often the right choice when there's only one question on a page, so you don't end up with a separate heading and a question saying the same thing.
Forms
Don't
Don't use the character counter for input fields where user entries typically have standard or predictable lengths.
Do
Use the character count only when there's a valid reason to limit the number of characters.
Do
Make empty text areas as tall as the content they are expected to contain.
Do
Ensure that the text area width is no longer than 75 characters per line; ideal line length is 45-75 characters.
Don't
Don't use a text area which is only one line high; instead, use text input if just one line is needed.
Do
If you suggest a specific length for an answer to a question, display a word count to help guide the user.
All GoA Design System components are built to meet WCAG 2.2 AA standards.
The following guidelines provide additional context for accessible implementation.
No accessibility-specific guidelines have been documented for this component yet.