Specifies the input type for appropriate message spacing. Used with checkbox-list or radio-group.
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.
label
ReactNode
Creates a label for the form item. HTML content must be phrasing content, such as span, strong, or em elements.
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.
label
TemplateRef
Creates a label for the form item. HTML content must be phrasing content, such as span, strong, or em elements.
error
slot
Error text displayed under the form field. Leave blank to indicate a valid field.
helptext
slot
Help text displayed under the form field to provide additional explanation.
label
slot
Creates a label for the form item. HTML content must be phrasing content, such as span, strong, or em elements.
Examples
Ask a user for an address
Disabled button with a required field
Include descriptions for items in a checkbox list
Limit the width of helper text
Question page
More info
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.