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

Button

Buttons let people do something: start a service, send a form or save their progress.

Updated

Live example

Button
Controls
Property Control What it does
How important the action is
Size
Height and padding
Icon
Adds an icon
Preview hover, focus, disabled
The button text

Overview

A button lets people do something: start a service, send a form or save their progress.

It’s the most common way people move forward on a government website.

Use a button to

  • Start or submit something
  • Save, confirm or continue
  • Open a dialog on the same page

Don’t use a button to

  • Go to another page (use a link)
  • Show more text (use an accordion)
  • Decorate a heading

Variants

Use one primary button per page. Everything else steps down from it.

  • Primary

    The main thing to do on the page.

  • Secondary

    A second action next to a primary one.

  • Tertiary

    Less important actions, like Cancel or Back.

  • Special

    Only for ReportGov in the masthead.

  • Icon-only

    A compact action with a well-known icon, like search or next page. Always needs an accessible name.

Specifications

The properties developers set on the button: what each one is, its type and the values it accepts. The same in HTML, WordPress and React.

Button properties
Property Type Possible values Description
type string
  • primary default
  • secondary
  • tertiary
  • icon-only
  • special
How important the action is. Use one primary button per page.
size string
  • sm
  • md default
Height and padding of the button.
icon string
  • none default
  • with-icon
Shows an icon after the label. For an icon on its own, use type icon-only.
iconName string
  • arrow-right default
  • any NDS icon name
Which icon to show. Used when icon isn’t none.
label string
  • any text
The button text. Required. For icon-only buttons it becomes the accessible name.
disabled boolean
  • false default
  • true
Turns the button off. Prefer an enabled button and an error message on submit, so people can see what to fix.

Hover, focus and pressed are states the browser handles, not properties you set.

Use cases

Do

One primary action, placed last, with a supporting action before it.

Don’t

Two primary buttons side by side. People won’t know which one matters.

Pairing and placement

How buttons sit together. The same order and spacing on every site make services quicker to use.

Order

On desktop, right-align the buttons with the main action last: tertiary, secondary, then primary. On mobile, stack them full width with the primary on top.

Spacing

12px between buttons, in a row or a stack.

One primary

Only one primary in a group. If two actions matter equally, use secondary and tertiary.

Dialogs

Use secondary and tertiary buttons only.

ReportGov

Never next to a submit button, so people can’t file a complaint by mistake.

Desktop

Right-aligned, main action last.

Mobile

Stacked full width, primary on top.

Copywriting

The label is the instruction. People should know what happens before they press.

Start with a verb

“Start your application”, “Save and come back later”. Not “Application” or “OK”.

Say what happens

“Send application” is clearer than “Submit” or “Continue” on its own.

Keep it short

A few words. The button grows with the label, so long lines wrap on small screens.

Icon-only

Only hide the label when the icon is unmistakable, and always add an accessible name.

Accessibility

Built on a native <button> element, so it works with keyboards, screen readers and browser defaults like submit on Enter in a form.

Keyboard interaction for buttons
Key What it does
Enter Activates the button.
Space Activates the button when it has focus.
Tab Moves focus to the next control.
  • Use a button for actions on the page and a link for going somewhere else, even when they look the same.
  • Button text passes WCAG 2.2 AA contrast: 5.8:1 on primary, 14.3:1 on secondary and 16.3:1 on tertiary.
  • Keyboard focus shows a visible ring. border/focus is 4.5:1 on the page.
  • The smallest button is 32px high, above the 24px minimum target size (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 the nds-button component from 01 Library – Foundations. Don’t detach it.

References

Feedback

Report a problem with this page