Form card
A form card helps me focus and answer a few questions in a big online form.
Form cards enable users to easily progress through complex forms by providing a single-page presentation of important questions and form sections.
Details
- Extends: USWDS Form
- Honeycrisp: Form card organism
- Customization: Styles
- Modifier:
.cfa-form-card
,.cfa-form
,.cfa-form-card__graphic
,.cfa-form-card__heading
,.cfa-form-card__help-message
,.cfa-form-card__header-alert
,.cfa-form-card__content
,.cfa-form-card__input-select-group
,.cfa-form-card__footer
The Form card is a custom component that extends the USWDS Form. It includes the alert component, form group component, fieldset component, button component, and any other components necessary to create a form. The visual appearance uses design tokens from the Honeycrisp Form card organism. Further customization is applied using the CSS modifiers .cfa-form-card
, .cfa-form
, .cfa-form-card__graphic
, .cfa-form-card__heading
, .cfa-form-card__help-message
, .cfa-form-card__header-alert
, .cfa-form-card__content
, .cfa-form-card__input-select-group
, .cfa-form-card__footer
to add styles defined in a custom stylesheet.
Modifier. A modifier is a class name that applies a variant, type, or extended style customization to modify the component's visual appearance.
Examples
Guidance
The form card contains three major sections or slots that can be customized with additional content or components described below.
Header. This is the first section of the card that contains the following elements.
- Heading. The overall question of the card that the form fields relate to.
- Help message. Additional text that explains the question heading in further detail.
- Alert. Including additional text in an alert helps emphasize the importance of the information being asked for in the card or provides the applicant with time-sensitive information.
Content. This is the main body of the form card that may contain any of the following types of content.
- Process expectations. Expectations can be set for how long it takes an application to complete, the major steps of the application, or breakdowns of service offerings.
- Form element components. Any form group component includes text inputs, text areas, selects, checkboxes, or radios.
- Detailed examples. These may be sample answers, illustrations for hard-to-find information, or alternatives.
- Informational summaries. These may include next-step summaries that set clear expectations for application submission follow-up.
Footer. This is the last section of the card that may contain any of the following elements in this order.
- Continue button. This primary element allows a user to submit the information asked for in a form card or progress to the next form card.
- Skip button. This gives the applicant time and flexibility in providing the information asked for in the form card.
- Yes or no buttons. Form cards with yes or no questions prevent applicants from answering irrelevant questions.
- Subtle link. This type of link enables applicants to take alternative actions with their applications that are allowed but discouraged.
- Subtle text. This type of text is used to reassure applicants to build trust, whether it's a note to remind them that we are securely protecting their personal information or a small alert to inform them that information has been sent to them.
Form groups vs. Fieldsets. The header and content sections may use a fieldset
with a legend
element for the heading when the form card contains form element components.
- Form cards, with a combination of text inputs, text areas, selects, and checkbox group or radio group, will use the form group markup.
- All other form cards may use the
fieldset
andlegend
markup.- Form cards with single text input, text area, select, checkbox group or radio group.
- Form cards with multiple text inputs, text areas, or selects will use the fieldset markup.
Refer to additional guidance on the USWDS documentation site.
USWDS documentation siteAdditional references
- Complete a complex form, Progress easily | U.S. Web Design System (USWDS)
- Templates, Form Templates | U.S. Web Design System (USWDS)
- Templates, Authentication Pages | U.S. Web Design System (USWDS)
- Templates, Form | VA.gov Design System
- Question Pages | GOV.UK Design System
- Making labels and legends headings | GOV.UK Design System
Accessibility
Checklist Key
Design library component
Source and usage
- Sass stylesheet:
./_cfa-form-card.scss
- Thymeleaf template fragment:
./cfa-form-card.th.html
- Embedded Ruby (ERB) partial template:
./_cfa-form-card.html.erb