Skip to Content
Patternfly Logo

Data toolbar

Info alert:Beta feature

This Beta component is currently under review, so please join in and give us your feedback on the PatternFly forum

The Data Toolbar component provides a flexible system for creating responsive toolbars that manage the data displayed in a list, table, or any other data view. Toolbar configurations can be customized to support a variety of use cases. Related design guidelines: Filters

IntroductionExamplesDocumentationCSS Variables

Introduction

Data toolbar relies on groups (.pf-c-data-toolbar__group) and items (.pf-c-data-toolbar__item), with default spacer values. Groups and items can be siblings and/or items can be nested within groups. Modifier selectors adjust spacing based on the type of group or item. Each modifier applies a unique CSS variable, therefore, the base spacer value for all elements can be customized and item/groups spacers can be themed individually. The default spacer value for items and groups is set to --pf-c-data-toolbar--spacer--base, whose value is --pf-global--spacer--md or 16px.

Default spacing for items and groups:

ClassCSS VariableComputed Value
.pf-c-data-toolbar__item--pf-c-data-toolbar__item--spacer16px
.pf-c-data-toolbar__group--pf-c-data-toolbar__group--spacer16px

Data toolbar item types

ClassApplied toOutcome
.pf-m-bulk-select.pf-c-data-toolbar__itemInitiates bulk select spacing. Spacer value is set to var(--pf-c-data-toolbar--m-bulk-select--spacer).
.pf-m-overflow-menu.pf-c-data-toolbar__itemInitiates overflow menu spacing. Spacer value is set to var(--pf-c-data-toolbar--m-overflow-menu--spacer).
.pf-m-pagination.pf-c-data-toolbar__itemInitiates pagination spacing and margin. Spacer value is set to var(--pf-c-data-toolbar--m-pagination--spacer).
.pf-m-search-filter.pf-c-data-toolbar__itemInitiates search filter spacing. Spacer value is set to var(--pf-c-data-toolbar--m-search-filter--spacer).

Modifiers

ClassApplied toOutcome
.pf-m-hidden{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to be hidden, at optional breakpoint.
.pf-m-visible{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to be shown, at optional breakpoint.
.pf-m-align-right{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to align right, at optional breakpoint.
.pf-m-align-left{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to align left, at optional breakpoint.

Special notes

Several components in the following examples do not include functional and/or accessibility specifications (for example .pf-c-select, .pf-c-options-menu). Rather, .pf-c-data-toolbar focuses on functionality and accessibility specifications that apply to it only.

Available breakpoints are: -on-md, -on-lg, -on-xl, -on-2xl.

Examples

Simple

Item
Item
Item

Item
Item
Item

Item
Item
Item

Item types

ClassApplied toOutcome
.pf-c-data-toolbar__item<div>Initiates the toolbar component item. Required
.pf-c-data-toolbar__group<div>Initiates the toolbar component group.

Spacers

In some instances, it may be necessary to adjust spacing explicitly where items are hidden/shown. For example, if a .pf-m-toggle-group is adjacent to an element being hidden/shown, the spacing may appear to be inconsistent. If possible, rely on modifier values. Available spacer modifiers are .pf-m-spacer-{none, sm, md, lg}{-on-md, -on-lg, -on-xl} and .pf-m-space-items-{none, sm, md, lg}{-on-md, -on-lg, -on-xl}. These modifiers will overwrite existing modifiers provided by .pf-c-data-toolbar.

Adjusted spacers

Item
Item
Item
Item

Item
Item

Adjusted group spacers

Item
Item

Item
Item

Data toolbar spacers

ClassApplied toOutcome
.pf-m-spacer-{none, sm, md, lg}{-on-[breakpoint]}.pf-c-data-toolbar__group, .pf-c-data-toolbar__itemModifies toolbar group or item spacing.
.pf-m-space-items-{none, sm, md, lg}{-on-[breakpoint]}.pf-c-data-toolbar__groupModifies toolbar group child spacing.

Group types

Data toolbar group types

ClassApplied toOutcome
.pf-m-filter-group.pf-c-data-toolbar__groupModifies toolbar group spacing. Spacer value is set to var(--pf-c-data-toolbar__group--m-filter-group--spacer). Child spacer value is set to var(--pf-c-data-toolbar__group--m-filter-group--space-items).
.pf-m-icon-button-group.pf-c-data-toolbar__groupModifies toolbar group spacing. Spacer value is set to var(--pf-c-data-toolbar__group--m-toggle-group--spacer). Child spacer value is set to var(--pf-c-data-toolbar__group--m-icon-button-group--space-items).
.pf-m-button-group.pf-c-data-toolbar__groupModifies toolbar group spacing. Spacer value is set to var(--pf-c-data-toolbar__group--m-toggle-group--spacer). Child spacer value is set to var(--pf-c-data-toolbar__group--m-button-group--space-items).

Toggle group

Toggle group on mobile (filters collapsed, expandable content expanded)

Toggle group modifier

The .pf-m-toggle-group controls when, and at which breakpoint, filters will be hidden/shown. By default, all filters are hidden until the specified breakpoint is reached. .pf-m-show-on-{md, lg, xl} controls when filters are shown and when the toggle button is hidden.

Accessibility

AttributeApplied toOutcome
hidden.pf-c-data-toolbar__item, .pf-c-data-toolbar__group, .pf-c-data-toolbar__toggle, .pf-c-data-toolbar__expandable-contentIndicates that the toggle group element is hidden. Required
aria-expanded="true".pf-c-data-toolbar__toggle > .pf-c-buttonIndicates that the expandable content is visible. Required
aria-expanded="false".pf-c-data-toolbar__toggle > .pf-c-buttonIndicates the the expandable content is hidden. Required
aria-controls="[id of expandable content]".pf-c-data-toolbar__toggle > .pf-c-buttonIdentifies the expanded content controlled by the toggle button. Required
id="[expandable-content_id]".pf-c-data-toolbar__expandable-contentProvides a reference for toggle button description. Required

Responsive attributes

AttributeApplied toOutcome
aria-haspopup="true".pf-c-data-toolbar__toggle > .pf-c-buttonWhen expandable content appears above content (mobile viewport), aria-haspopup="true" should be applied to indicate that focus should be trapped. Required

Usage

ClassApplied toOutcome
.pf-m-show{-on-[breakpoint]}.pf-c-data-toolbar__group.pf-m-toggle-group, .pf-c-data-toolbar__expandable-contentModifies toolbar element visibility at breakpoint. This selector must be applied consistently to toggle group and expandable content.
.pf-m-chip-container.pf-c-data-toolbar__content-section, .pf-c-data-toolbar__groupModifies the data toolbar element for applied filters layout.
.pf-m-expanded.pf-c-data-toolbar__expandable-content, .pf-c-data-toolbar__toggleModifies the component for the expanded state.

Selected

Selected filters on mobile (filters collapsed, selected filters summary visible)

6 filters applied

Selected filters on mobile (filters collapsed, expandable content expanded)

  • Status

    • Chip one
    • Chip two
    • Chip three
  • Risk

    • Chip one
    • Chip two
    • Chip three

Selected filters on desktop (not responsive)

  • Status

    • Chip one
    • Chip two
    • Chip three
  • Risk

    • Chip one
    • Chip two
    • Chip three

Stacked

Stacked on desktop


37 items
1 - 10of 37

Stacked on mobile (filters collapsed, expandable content expanded)

Resource
Status
Type

37 items
1 - 10of 37

Expanded elements

Expanded elements

Documentation

Overview

As the data toolbar component is a hybrid layout and component, some of its elements are presentational, while some require accessibility support.

Usage

ClassApplied toOutcome
.pf-c-data-toolbar<div>Initiates the toolbar component. Required
.pf-c-data-toolbar__item<div>Initiates a toolbar item. Required
.pf-c-data-toolbar__group<div>Initiates a toolbar group.
.pf-c-data-toolbar__content<div>Initiates a toolbar content container. Required
.pf-c-data-toolbar__content-section<div>Initiates a toolbar content section. This is used to separate static elements from dynamic elements within a content container. There should be no more than one .pf-c-data-toolbar__content-section per .pf-c-data-toolbar__content Required
.pf-c-data-toolbar__expandable-content<div>Initiates a toolbar expandable content section.
.pf-m-expanded.pf-c-data-toolbar__expandable-contentModifies expandable content section for the expanded state.
.pf-m-bulk-select.pf-c-data-toolbar__itemInitiates bulk select spacing.
.pf-m-overflow-menu.pf-c-data-toolbar__itemInitiates overflow menu spacing.
.pf-m-pagination.pf-c-data-toolbar__itemInitiates pagination spacing and margin.
.pf-m-search-filter.pf-c-data-toolbar__itemInitiates search filter spacing.
.pf-m-chip-group.pf-c-data-toolbar__itemInitiates chip group spacing.
.pf-m-button-group.pf-c-data-toolbar__groupInitiates button group spacing.
.pf-m-icon-button-group.pf-c-data-toolbar__groupInitiates icon button group spacing.
.pf-m-filter-group.pf-c-data-toolbar__groupInitiates filter group spacing.
.pf-m-hidden{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to be hidden, at optional breakpoint.
.pf-m-visible{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to be shown, at optional breakpoint.
.pf-m-align-right{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to align right, at optional breakpoint.
.pf-m-align-left{-on-[breakpoint]}.pf-c-data-toolbar > *Modifies toolbar element to align left, at optional breakpoint.
.pf-m-label.pf-c-data-toolbar__itemModifies toolbar item to label.
.pf-m-chip-container.pf-c-data-toolbar__content, .pf-c-data-toolbar__groupModifies the data toolbar element for applied filters layout.
.pf-m-expanded.pf-c-data-toolbar__expandable-content, .pf-c-data-toolbar__toggleModifies the component for the expanded state.

Accessibility

AttributeApplied toOutcome
hidden.pf-c-data-toolbar__item, .pf-c-data-toolbar__group, .pf-c-data-toolbar__toggle, .pf-c-data-toolbar__expandable-contentIndicates that the data toolbar element is hidden. Required
aria-expanded="true".pf-c-data-toolbar__toggle > .pf-c-buttonIndicates that the expandable content is visible. Required
aria-expanded="false".pf-c-data-toolbar__toggle > .pf-c-buttonIndicates the the expandable content is hidden. Required
aria-controls="[id of expandable content]".pf-c-data-toolbar__toggle > .pf-c-buttonIdentifies the expanded content controlled by the toggle button. Required
id="[expandable-content_id]".pf-c-data-toolbar__expandable-contentProvides a reference for toggle button description. Required

Toggle group usage

ClassApplied toOutcome
.pf-m-toggle-group.pf-c-data-toolbar__groupModifies toolbar group to control when, and at which breakpoint, filters will be hidden/shown. By default, all filters are hidden until the specified breakpoint is reached.
.pf-m-show{-on-[breakpoint]}.pf-c-data-toolbar__group.pf-m-toggle-group, .pf-c-data-toolbar__expandable-contentModifies toolbar element to hidden at breakpoint. This selector must be applied consistently to toggle group and expandable content.

Spacer system

ClassApplied toOutcome
.pf-m-spacer-{none, sm, md, lg, xl}{-on-[breakpoint]}.pf-c-data-toolbar__group, .pf-c-data-toolbar__itemModifies toolbar group or item spacing.
.pf-m-space-items-{none, sm, md, lg, xl}{-on-[breakpoint]}.pf-c-data-toolbar__groupModifies toolbar group child spacing.

CSS Variables

.pf-c-data-toolbar--pf-c-data-toolbar--BackgroundColor
#fff
.pf-c-data-toolbar--pf-c-data-toolbar--RowGap
1.5rem
.pf-c-data-toolbar--pf-c-data-toolbar--PaddingTop
1rem
.pf-c-data-toolbar--pf-c-data-toolbar--PaddingBottom
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__content--PaddingRight
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__content--PaddingLeft
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--PaddingTop
1.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--PaddingRight
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--PaddingBottom
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--PaddingLeft
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--lg--PaddingRight
0
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--lg--PaddingBottom
0
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--lg--PaddingLeft
0
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--ZIndex
100
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--BoxShadow
0 0.5rem 0.5rem -0.375rem rgba(3, 3, 3, 0.18)
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--BackgroundColor
#fff
.pf-c-data-toolbar--pf-c-data-toolbar__expandable-content--m-expanded--GridRowGap
1.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-chip-container--MarginTop
calc(1rem * -1)
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-chip-container__item--MarginTop
1rem
.pf-c-data-toolbar--pf-c-data-toolbar--spacer--base
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__item--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-toggle-group--spacer
0.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-toggle-group--m-show--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-icon-button-group--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-icon-button-group--space-items
0
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-button-group--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-button-group--space-items
0.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-filter-group--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__group--m-filter-group--space-items
0
.pf-c-data-toolbar--pf-c-data-toolbar__item--m-overflow-menu--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__item--m-bulk-select--spacer
1.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__item--m-search-filter--spacer
0.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__item--m-chip-group--spacer
0.5rem
.pf-c-data-toolbar--pf-c-data-toolbar__item--m-label--spacer
1rem
.pf-c-data-toolbar--pf-c-data-toolbar__item--m-label--FontWeight
600
.pf-c-data-toolbar--pf-c-data-toolbar__toggle--m-expanded__c-button--m-plain--Color
#151515
.pf-c-data-toolbar--pf-c-data-toolbar--c-divider--m-vertical--spacer
1rem
.pf-c-data-toolbar__content-section > .pf-c-divider--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__content-section > .pf-c-divider.pf-m-vertical:last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar__group--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__group.pf-m-button-group--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__group.pf-m-button-group > *--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar__group.pf-m-icon-button-group--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__group.pf-m-icon-button-group > *--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar__group.pf-m-filter-group--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__group.pf-m-filter-group > *--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar__group.pf-m-toggle-group--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar__group:last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar__item--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__item.pf-m-overflow-menu--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__item.pf-m-bulk-select--pf-c-data-toolbar--spacer
1.5rem
.pf-c-data-toolbar__item.pf-m-search-filter--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar__item.pf-m-chip-group--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar__item.pf-m-label--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__item:last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar__expandable-content .pf-c-data-toolbar__group--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar__content.pf-m-chip-container .pf-c-data-toolbar__item--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__content.pf-m-chip-container .pf-c-data-toolbar__group--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar__content.pf-m-chip-container .pf-c-data-toolbar__group:last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-c-chip-group:last-child--pf-c-chip-group--MarginRight
0
.pf-c-data-toolbar .pf-c-chip-group li:last-child--pf-c-chip-group__li--m-toolbar--MarginRight
0
.pf-m-toggle-group.pf-m-show--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar .pf-m-space-items-none > *--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-space-items-none > :last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-space-items-sm > *--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar .pf-m-space-items-sm > :last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-space-items-md > *--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar .pf-m-space-items-md > :last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-space-items-lg > *--pf-c-data-toolbar--spacer
1.5rem
.pf-c-data-toolbar .pf-m-space-items-lg > :last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-spacer-none--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-spacer-none:last-child--pf-c-data-toolbar--spacer
0
.pf-c-data-toolbar .pf-m-spacer-sm--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar .pf-m-spacer-sm:last-child--pf-c-data-toolbar--spacer
0.5rem
.pf-c-data-toolbar .pf-m-spacer-md--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar .pf-m-spacer-md:last-child--pf-c-data-toolbar--spacer
1rem
.pf-c-data-toolbar .pf-m-spacer-lg--pf-c-data-toolbar--spacer
1.5rem
.pf-c-data-toolbar .pf-m-spacer-lg:last-child--pf-c-data-toolbar--spacer
1.5rem
.pf-c-data-toolbar__content-section > :last-child--pf-c-data-toolbar--spacer
0