Splits related content on one page into panels that people switch between, without leaving the page.
Added · New
Live example
Tabs
Overview
Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.
Who can apply
Any Nigerian citizen can apply. A parent or guardian applies for children under 18.
What you need
Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.
Fees
The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.
Tabs
The page after your script runs. Render it without nds-tabs--enhanced and without hidden, and every panel shows in order
<divclass="nds-tabs nds-tabs--enhanced"><divclass="nds-tabs__bar"><divclass="nds-tabs__list"role="tablist"aria-label="Passport application"><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-1"aria-selected="true"aria-controls="tabs-panel-1"tabindex="0"> Overview</button><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-2"aria-selected="false"aria-controls="tabs-panel-2"tabindex="-1"> Who can apply</button><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-3"aria-selected="false"aria-controls="tabs-panel-3"tabindex="-1"> What you need</button><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-4"aria-selected="false"aria-controls="tabs-panel-4"tabindex="-1"> Fees</button></div></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-1"aria-labelledby="tabs-tab-1"tabindex="0"><h2class="nds-tabs__heading"> Overview</h2><p> Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.</p></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-2"aria-labelledby="tabs-tab-2"tabindex="0" hidden><h2class="nds-tabs__heading"> Who can apply</h2><p> Any Nigerian citizen can apply. A parent or guardian applies for children under 18.</p></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-3"aria-labelledby="tabs-tab-3"tabindex="0" hidden><h2class="nds-tabs__heading"> What you need</h2><p> Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.</p></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-4"aria-labelledby="tabs-tab-4"tabindex="0" hidden><h2class="nds-tabs__heading"> Fees</h2><p> The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.</p></div></div>
Usage
<!-- wp:nds/tabs {} --><divclass="nds-tabs nds-tabs--enhanced"><divclass="nds-tabs__bar"><divclass="nds-tabs__list"role="tablist"aria-label="Passport application"><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-1"aria-selected="true"aria-controls="tabs-panel-1"tabindex="0"> Overview</button><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-2"aria-selected="false"aria-controls="tabs-panel-2"tabindex="-1"> Who can apply</button><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-3"aria-selected="false"aria-controls="tabs-panel-3"tabindex="-1"> What you need</button><buttontype="button"class="nds-tabs__tab"role="tab"id="tabs-tab-4"aria-selected="false"aria-controls="tabs-panel-4"tabindex="-1"> Fees</button></div></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-1"aria-labelledby="tabs-tab-1"tabindex="0"><h2class="nds-tabs__heading"> Overview</h2><p> Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.</p></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-2"aria-labelledby="tabs-tab-2"tabindex="0" hidden><h2class="nds-tabs__heading"> Who can apply</h2><p> Any Nigerian citizen can apply. A parent or guardian applies for children under 18.</p></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-3"aria-labelledby="tabs-tab-3"tabindex="0" hidden><h2class="nds-tabs__heading"> What you need</h2><p> Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.</p></div><divclass="nds-tabs__panel"role="tabpanel"id="tabs-panel-4"aria-labelledby="tabs-tab-4"tabindex="0" hidden><h2class="nds-tabs__heading"> Fees</h2><p> The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.</p></div></div><!-- /wp:nds/tabs -->
Usage
import{ Tabs }from"@nigerian-design-standards/react";<Tabslabel="Passport application"tabs={[{ label: "Overview", content: <p>Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.</p> },{ label: "Who can apply", content: <p>Any Nigerian citizen can apply. A parent or guardian applies for children under 18.</p> },{ label: "What you need", content: <p>Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.</p> },{ label: "Fees", content: <p>The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.</p> }, ]}/>
Usage
use NDS\Components\Tabs;echo Tabs::render(['label'=>'Passport application','tabs'=> [ ['label'=>'Overview', 'content'=>'<p>Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.</p>'], ['label'=>'Who can apply', 'content'=>'<p>Any Nigerian citizen can apply. A parent or guardian applies for children under 18.</p>'], ['label'=>'What you need', 'content'=>'<p>Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.</p>'], ['label'=>'Fees', 'content'=>'<p>The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.</p>'], ],]);
Overview
Use tabs to split related content on one page into a few panels. People switch panels without leaving the page, and most only need one of them.
Use tabs for
Content in 2 to 5 clear, separate parts
Parts people don’t need to compare side by side
Parts with short, obvious labels
Don’t use tabs for
Content people need to read in order (use headings)
Steps in a process, or a form split across tabs
Page navigation (tabs never change the URL)
Examples
Two versions. Without JavaScript, and in print, every panel shows in order under its own heading.
Overview
Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.
Who can apply
Any Nigerian citizen can apply. A parent or guardian applies for children under 18.
What you need
Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.
Fees
The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.
Desktop
A tab list over one panel. Up to 5 tabs, left aligned, never wrapping.
Overview
Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.
Who can apply
Any Nigerian citizen can apply. A parent or guardian applies for children under 18.
What you need
Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.
Fees
The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.
Mobile
The tabs that fit, then More. More opens a menu of the rest; a tab chosen there swaps into the slot next to More.
Specifications
The properties of tabs. The same in HTML and React.
Tabs properties
Property
Type
Possible values
Description
tabs
array
label + content
Required. 2 to 5 tabs, in order. Each panel starts with a heading that repeats its label.
selected
number
0 – (tabs − 1)
Optional. Defaults to 0, the first tab.
label
string
text
Required. The aria-label for the tab list. Says what the tabs are about.
activation
string
"automatic"
"manual"
Optional. Use "manual" if panels are slow to load: arrows move focus, Enter opens. Defaults to "automatic".
In code, the row is role="tablist" with an aria-label. Each tab is <button role="tab" aria-selected aria-controls id>; only the
selected tab has tabindex="0". Each panel is role="tabpanel" aria-labelledby tabindex="0", and hidden panels
use the hidden attribute. Without JavaScript every panel shows in order under its
heading. On small screens, More is a separate <button aria-haspopup="true" aria-expanded> after the tablist, not a
tab.
Tokens
Tabs tokens and contrast
Part
Token
Contrast on the page
Unselected tab
Label/medium · text/secondary
6.6:1
Selected tab
Label/medium · text/primary · 4px action/primary/default bar (spacing/050)
17.6:1 · bar 5.8:1
Divider line
border/divider at border/width/thin
Decorative
Hover
action/tertiary/hover tint · radius/050 top corners
—
Tab size
spacing/200 × spacing/150 padding, at least 48px tall
—
Panel
spacing/400 below the list and between stacked sections
—
Focus
Input Keyboard Focus effect
—
Use cases
Do
Overview
Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.
Who can apply
Any Nigerian citizen can apply. A parent or guardian applies for children under 18.
What you need
Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.
Fees
The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.
On small screens, show the tabs that fit and put the rest behind More. Start every panel with a heading that matches its tab.
Don’t
Overview
Use this service to apply for a new Nigerian passport or renew one that has expired. It takes about 20 minutes, and you will need to book an appointment to have your photo and fingerprints taken.
Who can apply
Any Nigerian citizen can apply. A parent or guardian applies for children under 18.
What you need
Your National Identification Number (NIN), a recent photo, and your old passport if you are renewing.
Fees
The fee depends on the number of pages and how long the passport is valid. You pay online when you book your appointment.
How to apply
Fill in the form online, pay the fee and book an appointment at a passport office near you.
Contact us
Call or email the passport office if you have a question about your application.
Don’t wrap tabs onto two lines, nest tabs, or use tabs to move between pages. If only one tab fits before More, use headings instead.
Layout
Where tabs go and how they behave.
Left aligned, on a divider line
Up to 5 tabs. The row never wraps.
Each tab at least 48px tall
Label/medium, one or two words.
Panel below the list
spacing/400 below, starting with a heading that repeats the tab label.
More on small screens
The tabs that fit, then More at the right end, after a short divider.
Without JavaScript or in print
Every panel shows in order, under its own heading.
Copywriting
How to write tab labels.
One or two words
“Fees”, “Who can apply”.
Keep labels the same kind
All nouns, or all questions, not a mix.
Start each panel with a heading
Using the same words as the tab.
Name the tab list
The aria-label says what the tabs are about.
Icons beside, not instead
Never an icon on its own.
More always says “More”
Even when a hidden tab is open.
Examples
Tabs copywriting examples
Write
Don’t write
Why
Fees
Click here for fees
Short labels fit and scan.
Who can apply
Eligibility criteria and requirements
One or two words.
Overview · What you need · Fees
Overview · What do I need? · Costs
Keep labels the same kind.
Panel starts with “Fees”
Panel with no heading
Stacked panels still read in order.
More
Other tabs
Always the same word.
Accessibility
Tabs follow the WAI-ARIA tabs pattern: only the selected tab is in the tab order, and the arrow keys move between tabs.
Keyboard interaction for tabs
Key
What it does
Tab
Moves to the selected tab, then on to its panel. It doesn’t visit the other tabs.
← / →
Moves to the previous or next tab and opens its panel. Wraps from last to first.
Enter / Space
With manual activation, opens the focused tab. On More, opens the menu.
role="tablist", "tab" and "tabpanel", linked with aria-controls and aria-labelledby (WCAG 1.3.1, 4.1.2).
Roving tabindex: only the selected tab can be focused, and arrows move between tabs (WCAG 2.1.1, 2.4.3).
The selected tab has a 4px bar as well as darker text, not colour alone (WCAG 1.4.1).
Without JavaScript and in print, every panel shows under its heading, so nothing is hidden (WCAG 1.3.2).
Labels 6.6:1 and 17.6:1, bar 5.8:1. Tabs are at least 48px tall (WCAG 1.4.3, 1.4.11, 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.