Skip to content

Official government website An official website of the Federal Government of Nigeria

How you know
Federal Ministry of Communications, Innovation & Digital Economy Nigerian Design Standards

Input group

Asks one question in several fields, like a person’s name in First, Middle and Last name parts.

Updated

Live example

Input group
Your name

As it appears on your NIN slip

(optional)
Controls
Property Control What it does
Stacked for names, on every screen size
Error
Shows an error on the field that needs fixing

Overview

An input group wraps related fields in a fieldset, with one legend for the question. Each field keeps its own label and its own error.

Use an input group for

  • A person’s name: First, Middle (optional) and Last
  • Other answers asked in parts, where each part needs its own label
  • Keeping related fields together under one question

Don’t use an input group for

  • One “Full name” box (always ask for names in parts)
  • A date (use the date input)
  • Questions that aren’t related (use separate fields)

Variants

Stacked is the one to use. Row is in Figma for short parts, but names always stack.

Your name

As it appears on your NIN slip

(optional)

Stacked

Fields 24px apart, on every screen. Names vary in length.

Your name

As it appears on your NIN slip

(optional)

Row

In Figma for short parts. Not used for names.

Your name

As it appears on your NIN slip

(optional)

Error

The field that needs fixing shows its own error message.

Specifications

The properties of Form/Input group. The same in HTML, WordPress and React.

Input group properties
Property Type Possible values Description
legend string
  • Your name
The question. No asterisk: each field marks itself.
direction string
  • stacked default
  • row
Stacked on every screen size for names.
error boolean
  • false default
  • true
Shows the error on the field that needs fixing.
fields array
  • { name, label, autocomplete }
The parts, each with its own label.

In code, use <fieldset> with a <legend>, and aria-describedby for the hint. Name fields use autocomplete given-name, additional-name and family-name.

Tokens

Input group tokens and contrast
Part Token Contrast on the page
Legend text/primary 17.6:1
Gap between fields spacing/300 (24px) —
Field border border/strong, 1px 4.2:1
Border in an error status/error/surface, 1px 4.9:1

Use cases

Do

Your name

As it appears on your NIN slip

(optional)

Ask for First, Middle (optional) and Last name, each with its own label.

Don’t

Your name

As it appears on your NIN slip

(optional)

Don’t squeeze name fields into one row. Long names get cut off.

Layout

How the group sits on a form.

Legend, hint, then fields
In that order, with 8px under the legend.
24px between fields
Inside the group. 32px to the next question.
Stacked everywhere
Names vary in length, so the fields stack on every screen.
Mark optional parts
Put “(optional)” on that field’s own label.

Copywriting

How to write the legend, labels and errors.

Ask the question in the legend

“What is your name?” or “Your name”.

Label each part

First name, Middle name (optional), Last name.

Say which part is wrong

“Enter your last name”, not “Name is invalid”.

Examples

Input group copywriting examples
Write Don’t write Why
First name · Last name Full name Official forms ask for names in parts.
Middle name (optional) Middle name* Says it can be left blank.
Enter your last name Name is invalid Says which part to fix.

Accessibility

A fieldset and legend tell screen readers the fields belong to one question.

Keyboard interaction for Input group
Key What it does
Tab Moves to the next field in the group.
Shift+Tab Moves back to the previous field.
  • The legend is read with each field, so people hear the question (WCAG 1.3.1).
  • Each field has its own visible label (WCAG 3.3.2).
  • Errors are linked to their field with aria-describedby (WCAG 3.3.1).
  • Autocomplete lets browsers fill in names (WCAG 1.3.5).

For developers

Copy the code for HTML, WordPress or React from the Code tab in Live example. The options are listed under Specifications.

For designers

Use Input group from the NDS Website documentation frames. Match node 900:181239 for variants, tokens and copy.

References

Report a problem with this page