A NSW Government website
NSW Design System v3.27.0

Forms

🔹 Needed for NSW Government Branding

Forms are used to capture data from users.

Figma

Using forms

Forms comprise of the form itself and multiple form inputs. Each form is broken down into one or more fieldsets that groups the form elements into logical chunks that make sense to the user, for example, a delivery address.

Form elements are split into two key input types:

Freeform inputs - Free form text inputs are the most used components in forms. Use text fields and text areas for freeform entry. Text fields are used to input a short (single line) amount of freeform text. Text areas are used to input multiple lines of text, for example, a comments field. Use text areas when you expect longer entries.

Selection inputs - Selection inputs are used to select an option from a predefined list of available options. Selection options may be single-select or multi-select. Use a radio button list or dropdowns for single selections and checkboxes for multi-selections.

Guidance

Do
  • keep forms to one column as multiple columns can disrupt a user's vertical momentum
  • use input constraints for fields with a defined character count, such as phone numbers and postcodes
  • mark form fields as required or optional
  • use top aligned labels so forms are easier to scan and complete, including on mobile
  • make calls to action descriptive and state the intent of the action
  • specify errors inline, showing where the error occurred and what the user needs to do.
Don't
  • use all caps
  • hide helper text
  • use an in-page alert as a substitute for field-level validation or a validation summary.
  • use an information alert to communicate invalid or missing form data. Use the appropriate validation treatment instead.

Validation

Validation communicates whether a field or form meets its input requirements. When a requirement is not met, messages should explain what the issue is, where it occurred and how to fix it.

User feedback and contextual feedback

When communicating information related to a form or task, consider whether the message is about the user's interaction or the subject of the task.

  • User feedback communicates the outcome of a user action. Use success or error feedback as appropriate.
  • Contextual feedback communicates the current state of the subject of the form or task. Use information or warning feedback as appropriate.

Contextual feedback is based on the subject of a form or task, rather than the user's interaction with the form itself. For example, a user may enter a valid vehicle registration and the lookup returns that an inspection is required before renewal.

Use information feedback for status information the user should know but does not need to act on. Use warning feedback when the status requires action or affects what the user can do next.

When both types appear, structure them in the order users need to interpret them: user feedback first, followed by contextual feedback. Use this sequence for all field types.

Choosing an inline or standard alert

  • Multiple-field forms: use the compact alert inline, immediately after the field it relates to. This keeps the message close to its context without interrupting the rest of the form.
  • Single-field forms: use the standard, non-compact in-page alert after the field and its call to action. The alert provides feedback for the form's single task and does not need to compete with other fields.

Associate the message with its field using aria-describedby. Do not apply an error or warning state to a valid field: the alert describes the subject's status, not whether the user's input is valid.

Do not use success or error feedback for contextual feedback. These treatments communicate the outcome of a user action rather than the state of the subject.

For more guidance, see In-page alert.

Field types

Dropdown

The dropdown pattern, also referred to as a drop list or select list, allows users to select a single option from a list of available options.

Single checkbox

Single checkboxes are used to confirm a user's selection or preference like agreeing to terms and conditions or registering for an option.

Checkbox list

Checkbox lists provide the user with a list of available items to choose from. The number of items a user can select should be indicated to the user on the page. Checkbox lists are used where multiple selections are permitted. Checkbox lists are wrapped in a fieldset to make them one logical group.

Radio list

Radio lists provide the user with a list of all available items from which a single selection is made. Radio lists are wrapped in a fieldset to make them one logical group.

How this component works

Help text

Help text allows form designers to provide users with help to fill in a form element. Use help text to provide additional context, information or as an example to complete a field input.

Organising form elements

  • Differentiate primary from secondary actions
  • Group related information to ensure the user makes sense of the form faster
  • Enable autofill and autocorrect based on common attributes or responses, such as name and email, previously provided on the site or in the browser
  • Use multi-step forms in situations where there are multiple form fields, several of which could be split up into categories (such as “personal”, “shipping”, “billing”, and “payment review”).

Inactive fields and information

Do not render disabled form fields simply to display information. Avoid using disabled=true to present values, as this suggests interactivity when none is available. For read-only values, present the information outside of input fields, for example as plain text or within a summary list. This approach makes intent clear and avoids confusing users with inactive controls.

More information: Inactive fields method

Accessibility

All components are responsive and designed to comply with WCAG 2.2 AA accessibility standards. Full compliance depends on using and configuring the components correctly.

Ensuring compliance through usage

Redundant entry

To ensure WCAG 2.2 AA compliance for a full array of filter components, correct usage and configuration are vital. While each component provides a foundation for accessibility, it's essential to minimise redundant entry by retaining previously selected or entered filter values if a user revisits the page or refines their search. Ensure all filter options are clearly labelled and provide instructions where needed, so users understand the available choices and input formats. Additionally, allow users to modify their filter selections easily without resetting other filters.

Consistent help

Ensure each input, whether it's a text field, checkbox, radio button, dropdown, or date input, is clearly labelled with descriptive text to communicate its purpose. Consistent error messaging and validation feedback are crucial; provide users with clear, actionable instructions if errors occur, without requiring them to re-enter data unnecessarily. Keyboard navigation should be maintained across all inputs, with each respective field focus indicator allowing users to move easily between fields clearly.

Following these practices will help create accessible, user-friendly forms that offer a seamless experience across various input types.

User feedback

User feedback communicates the state of a field or the outcome of a user's interaction with the form.

Default

Text field

As it appears on your identity document
Maximum 500 characters
Show code Hide code

Input group

Show code Hide code

Predictive list

Show code Hide code

Date

Date of birth For example 08 12 1990
Show code Hide code

Select

Your region of residence
Show code Hide code

Checkbox

Category Select all that applies to you
Show code Hide code

Radio buttons

Topic Select closest match
Show code Hide code

Error

Text Fields

As it appears on your identity document This field is required
Maximum 500 characters This field is required
Show code Hide code

Date

Date of birth (required) For example 08 12 1990
This field is required
Show code Hide code

Select

Your region of residence This field is required
Show code Hide code

Checkboxes

This field is required
Category (required) Select all that applies to you This field is required
Show code Hide code

Radio buttons

Topic (required) Select closest match This field is required
Show code Hide code

Success

Text Fields

As it appears on your identity document This field has been validated
Maximum 500 characters This field has been validated
Show code Hide code

Date

Date of birth For example 08 12 1990
This field has been validated
Show code Hide code

Select

Your region of residence This field has been validated
Show code Hide code

Checkboxes

This field has been validated
Category Select all that applies to you This field has been validated
Show code Hide code

Radio buttons

Topic Select closest match This field has been validated
Show code Hide code

Contextual feedback

Contextual feedback communicates the current state of the subject of the form, rather than the outcome of the user's interaction.

Use an information treatment for relevant status information that the user should know but does not need to act on.

Compact inline alert

Enter a NSW plate number CTP insurance confirmed. The insurer has sent the policy details to Transport for NSW. You can continue.
Show code Hide code

Standard alert

Enter a NSW plate number

Concession recorded

This vehicle has a registration concession. Additional charges may apply if ownership is transferred. No action is needed to complete this check.

Show code Hide code

Use a warning treatment when the subject's status requires the user to take action or affects what they can do next.

Compact inline alert

Enter a NSW plate number Safety inspection required. Arrange an inspection before renewing this registration.
Show code Hide code

Standard alert

Enter a NSW plate number

Online renewal unavailable

This registration needs changes to its operating conditions. Visit a service centre to renew.

Show code Hide code

A field can show that a value was validated while a separate message explains the subject's status. Only show the valid confirmation when it helps the user.

Valid field with action required

Enter a NSW plate number
Registration number matched

Safety inspection required

This vehicle needs a safety inspection before you can renew the registration.

Show code Hide code