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

Combo box

Lets people pick one answer from a long list by typing to filter it, like an LGA, a country or a ministry.

Updated

Live example

Combo box
Controls
Property Control What it does
Default, filled, focus, open, open long list, open no results, disabled
Error
Shows the error message and a red border

Overview

A combo box is a text field with a list underneath. As people type, the list shrinks to the matches. Only answers from the list are accepted.

Use a combo box for

  • Long lists people know the answer to, like LGAs or countries
  • Lists of more than about 15 options
  • Ministries, agencies and other official names

Don’t use a combo box for

  • 7 to 15 options (use a select)
  • Fewer than 7 options (use radios)
  • Answers people type freely (use a text input)

States

What people see as they type. The list opens under the field and shows up to 6 matches before it scrolls.

Start typing, then choose from the list

Default

The label and an empty field, with a caret to show it opens.

  • Ikeja
  • Ikorodu
2 matches.

Open

Matches show as people type. The option the keyboard is on has a 2px border.

No matches for ‘Ikx’

Check the spelling, or type fewer letters

No matches for Ikx.

Open, no results

Says nothing matched and how to recover.

Error

Says what to fix, with a red border. What people typed stays.

Specifications

The properties of Form/Combo box. The same in HTML, WordPress and React.

Combo box properties
Property Type Possible values Description
state string
  • default default
  • filled
  • focus
  • open
  • disabled
Open shows the list. It scrolls after 6 options, with a visible scrollbar.
error boolean
  • false default
  • true
Shows the error message and a red border.
options array
  • { value, label }
The full list. Only these values are accepted.

In code, follow the WAI-ARIA combobox pattern: <input role="combobox" aria-expanded aria-controls aria-autocomplete="list"> and a <ul role="listbox">. Announce the number of matches with aria-live="polite".

Tokens

Combo box tokens and contrast
Part Token Contrast on the page
Border border/strong, 1px 4.2:1
Border when focused border/dark, 2px 14.3:1
Border in an error status/error/surface, 1px (2px when focused) 4.9:1
Menu surface/container, border/default 1px, radius/050 · below the field Exempt
Option the keyboard is on border/dark, 2px 14.3:1
Option height spacing/500 (40px) —

Use cases

Do

  • Ikeja
  • Ikorodu
2 matches.

Filter as people type, and keep the matches in the same order as the full list.

Don’t

  • Agege
  • Ajeromi-Ifelodun

Don’t use a combo box for a short list. If there are 15 options or fewer, use a select.

Layout

How the field and its list sit on a form.

List under the field
Opens 4px below the field, the same width as the field.
6 options, then scroll
The 7th option is cut in half, so it’s clear there are more.
40px options
Every option is 40px tall, for touch.
Full width on mobile
Like every field, it fills the width on mobile.

Copywriting

How to write the label, hint and messages.

Write the label in full

“Local government area (LGA)”, not just “LGA”.

Say what to do

A hint like “Start typing, then choose from the list”.

Say how to recover

“No LGA matches ‘lkj’. Check the spelling.”

Examples

Combo box copywriting examples
Write Don’t write Why
Local government area (LGA) Select LGA Says what to enter, in full.
Start typing, then choose from the list Type to search Says what happens next.
No LGA matches ‘lkj’. Check the spelling. No results Says how to recover.

Accessibility

Follows the WAI-ARIA combobox pattern, so screen readers announce the field, the list and how many matches there are.

Keyboard interaction for Combo box
Key What it does
↓ ↑ Moves through the options.
Enter Chooses the option the keyboard is on.
Esc Closes the list and keeps what was typed.
Tab Closes the list and moves on.
  • The number of matches is announced with aria-live (WCAG 4.1.3).
  • The option the keyboard is on has a 2px border, not just a fill (WCAG 1.4.11, 2.4.7).
  • Selected shows a check and bold text, not colour alone (WCAG 1.4.1).
  • The list closes on Esc, Tab or a click outside (WCAG 1.4.13).
  • Options are 40px tall, above the 24px minimum target (WCAG 2.5.8).

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 Combo box from the NDS Website documentation frames. Match node 900:179898 for states, tokens and copy.

References

Report a problem with this page