Skip to main content
Login

Sign in to access your account

Toolbar - National Design System

A controls bar above a table, list or grid, with result counts and filters at the start and actions at the end

Overview

A toolbar is a layout only. It has no script and no state. Two clusters hold its items: nds-toolbar-start at the leading edge, and nds-toolbar-end at the trailing edge. Each item, such as an Export group or a Filter, connects to its content through its own target attribute. The bar wraps its items onto more lines when they do not fit. To give items a line of their own, wrap each line in nds-toolbar-row.

Pick another component when:

  • the controls are the page’s navigation or its main action: the head of a Section.
  • the controls switch between separate panels of content: Tabs.

Markup

Preview
Start
End
Content
<div class="nds-toolbar"> <div class="nds-toolbar-start"> <div class="nds-content-placeholder nds-sm">Start</div> </div> <div class="nds-toolbar-end"> <div class="nds-content-placeholder nds-sm">End</div> </div> </div> <div class="nds-content-placeholder">Content</div>

Examples

Table Bar

A count and an export group on the first row, a search box on the second, and the applied filters on the third. Manage Records uses the same bar.

3 of 3 orders
Reference Entity Status
1041 Ministry of Interior Completed
1042 Ministry of Health In Review
1043 Ministry of Education Pending
<div class="nds-toolbar"> <div class="nds-toolbar-row"> <div class="nds-toolbar-start"> <span class="nds-toolbar-text" data-filter-target="toolbar-table-body"><span data-filter-count>3</span> of 3 orders</span> </div> <div class="nds-toolbar-end"> <div class="nds-export nds-btn-group"> <button type="button" class="nds-btn nds-secondary-outline nds-md" data-export="csv" data-export-target="#toolbar-table-orders"> <span class="nds-label">CSV</span> </button> <button type="button" class="nds-btn nds-secondary-outline nds-md" data-export="pdf" data-export-target="#toolbar-table-orders"> <span class="nds-label">PDF</span> </button> </div> </div> </div> <div class="nds-toolbar-row"> <div class="nds-form-container nds-search-box" data-filter-target="toolbar-table-body"> <div class="nds-search-content"> <div class="nds-form-control"> <i class="nds-icon nds-hgi-search-01" aria-hidden="true"></i> <input type="text" class="nds-search-input" placeholder="Search orders..." aria-label="Search orders"> <div class="nds-form-action"> <button class="nds-btn nds-subtle nds-clear nds-icon-only" type="button" hidden aria-label="Clear search" data-i18n-aria-label="form.clear_search"> <i class="nds-icon nds-hgi-cancel-01" aria-hidden="true"></i> </button> </div> </div> <button class="nds-btn nds-primary nds-search-btn" type="button"> <i class="nds-icon nds-hgi-search-01" aria-hidden="true"></i> <span class="nds-label" data-hidden="sm sr" data-i18n="filter.search">Search</span> </button> </div> </div> </div> <div class="nds-toolbar-row"> <div class="nds-toolbar-start"> <div class="nds-filter-applied" data-filter-target="toolbar-table-body" hidden> <span class="nds-label" data-i18n="filter.applied_filters">Applied Filters:</span> <div class="nds-chips"></div> </div> </div> </div> </div> <table id="toolbar-table-orders" class="nds-table" data-export-name="orders"> <thead> <tr> <th>Reference</th> <th>Entity</th> <th data-align="center">Status</th> </tr> </thead> <tbody id="toolbar-table-body" data-filter-items="tr"> <tr> <td>1041</td> <td>Ministry of Interior</td> <td><span class="nds-tag nds-sm" data-status="success"><span class="nds-label">Completed</span></span></td> </tr> <tr> <td>1042</td> <td>Ministry of Health</td> <td><span class="nds-tag nds-sm" data-status="info"><span class="nds-label">In Review</span></span></td> </tr> <tr> <td>1043</td> <td>Ministry of Education</td> <td><span class="nds-tag nds-sm" data-status="warning"><span class="nds-label">Pending</span></span></td> </tr> </tbody> </table>

Editor Bar

The toolbar of the Editor.

Built-in Features

  • Leading and Trailing Clusters

    The end cluster stays at the trailing edge, also when it wraps onto a line of its own.

  • Search Field Growth

    A search box placed straight in the bar or in a row fills the free space on its line. Outside a bar, it is a full-width panel.

  • Empty-Slot Collapse

    A cluster or a row whose items are all hidden takes no space. An applied-filters row leaves no gap until a filter is applied.

  • Bar Text

    nds-toolbar-text is block text in the paragraph color. A <b> in it shows in medium weight. It also works outside a bar.

Best Practices

  • Put the toolbar directly above the content it controls. Keep the content and its Pagination below the bar, not inside it.
  • Put every item in nds-toolbar-start or nds-toolbar-end. A search box is the one exception: it goes straight in the bar or in an nds-toolbar-row, where it fills the free space.
  • Choose a cluster by position, not by job. A table bar usually shows a count, applied filters or a selection summary at the start. It puts Export, a column menu or bulk actions at the end. An editor bar puts its format controls at the start and a source toggle at the end.
  • Use nds-toolbar-row only when the bar has two or more rows, or a row and another item. A row that is the bar’s only child changes nothing. For two or three items, use no rows: the bar wraps them itself.
  • Give the search box most of its line, on a phone above all. Put one control beside it, a Filter or a sort menu, not both. Move the rest to another nds-toolbar-row. NDS.init.audit() warns about a crowded search line.
  • Put the applied filters in the toolbar, in their own nds-toolbar-row right under the search and filter row, never outside the bar.
  • Do not crowd one row. Keep closely related items together and move the others to their own row. Small icon buttons can share a row; a wide item, such as a search box or a long count, needs room.
  • Use the toolbar on every data screen, so all bars have one layout. A layout made with Grid also works, because each item connects to its content by itself.
  • Do not put a toolbar inside another toolbar. Use nds-toolbar-row: it has the same layout, with no outer margin.
  • Keep the hidden attribute on items that start empty, such as the applied-filters row. Without it, the bar keeps an empty line.
  • Keep the end cluster to one or two items. Put related buttons in an nds-btn-group, so they read as one control.
  • Use one size for every item on a line, buttons and search box alike. A default button is 40px tall, as the search box is, and an nds-md button is 32px. NDS.init.audit() warns about a line with mixed heights.
  • Add data-hidden="sm sr" to a button label to show only the icon on phones. Screen readers still read the label. See Hidden.

API

Classes

Class Element Effect
nds-toolbar div above the content The bar. It spans the width of its container
nds-toolbar-row div in .nds-toolbar Takes a line of its own. Its items have the same layout as the bar’s, with no outer margin
nds-toolbar-start div in .nds-toolbar or .nds-toolbar-row The items at the leading edge, var(--spacing-md) apart
nds-toolbar-end div in .nds-toolbar or .nds-toolbar-row The items at the trailing edge, var(--spacing-md) apart
nds-toolbar-text span in a cluster, or on its own Text such as a record count or a selection summary. nds-results-count is the same class under its first name

CSS Custom Properties

Property Default Controls
--toolbar-margin-block 0 var(--spacing-2xl) The space above and below the bar, as <above> <below>. Set it on the bar or on a parent

Tokens

It reads these shared tokens. A change to one also changes other components: see Tokens.

Source: the var() reads in _sass/components/_toolbar.scss.

TokenPreviewValue
--text-primary-paragraph
Read by color

var(--colors-neutral-700)
Dark mode var(--colors-neutral-300)
Last Modified Date: 10/11/2026 - 06:00 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks