import ’./Toolbar.css’

Toolbar relies on groups (.pf-v6-c-toolbar__group) and items (.pf-v6-c-toolbar__item), with default col/row gap 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. The default column-gap value for items and groups is set to --pf-v6-c--ColumnGap, whose value is --pf-t--global--spacer--md or 16px. The default row-gap value for items and groups is set to --pf-v6-c--RowGap, whose value is --pf-t--global--spacer--sm or 8px.

Default spacing for items and groups:

ClassCSS VariableComputed Value
.pf-v6-c-toolbar__group--pf-v6-c-toolbar__group--ColumnGap16px
.pf-v6-c-toolbar__item--pf-v6-c-toolbar__item--ColumnGap16px
.pf-m-[column/row]-gap-[none/sm/md/lg/xl/2xl]{-on-[breakpoint]}.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar group or item spacing at optional breakpoint.
.pf-m-gap-[none/sm/md/lg/xl/2xl]{-on-[breakpoint]}.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies both column gap and row gap for toolbar group or item spacing at optional breakpoint.

Toolbar item types

ClassApplied toOutcome
.pf-m-pagination.pf-v6-c-toolbar__itemInitiates pagination and margin.

Modifiers

ClassApplied toOutcome
.pf-m-[hidden/visible].pf-v6-c-toolbar > *Modifies toolbar element to be hidden/visible.
.pf-m-[hidden/visible]{-on-[breakpoint]}.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar elements to be hidden/visible on an option breakpoint.
.pf-m-[hidden/visible]{-on-[breakpoint]}-height.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar elements to be hidden/visible on an option height breakpoint. Primarily for use with vertical toolbars.
.pf-m-flex-grow.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar element to flex-grow: 1, allowing it to consume available main-axis space.
.pf-m-align-[start/end].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar main axis element alignment.
.pf-m-align-items-[stretch/baseline/start/center/end].pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar element cross axis child alignment.
.pf-m-align-self-[stretch/baseline/start/center/end].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar element cross axis self alignment.

Special notes

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

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

Examples

Simple

Item types

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

No padding

Adjusted group column gap

Insets

Toolbar spacers and insets

ClassApplied toOutcome
.pf-m-column-gap-[none/sm/md/lg].pf-v6-c-toolbar__groupModifies toolbar group child spacing.
.pf-m-inset-[none/sm/md/lg/xl/2xl].pf-v6-c-toolbarModifies toolbar horizontal.

Width control

Width control usage

ClassApplied toOutcome
--pf-v6-c-toolbar__item--Width: {width}.pf-v6-c-toolbar__itemModifies the width value of a toolbar item at optional breakpoint.
--pf-v6-c-toolbar__item--MinWidth: {width}.pf-v6-c-toolbar__itemModifies the min width value of a toolbar item at optional breakpoint.

Group types

Filter group

Action group

Action group plain

Action group inline

Label group

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

Toggle group on desktop

Toolbar group types

ClassApplied toOutcome
.pf-m-filter-group.pf-v6-c-toolbar__groupModifies toolbar group column gap.
.pf-m-action-group.pf-v6-c-toolbar__groupModifies toolbar group column gap for action group.
.pf-m-action-group-plain.pf-v6-c-toolbar__groupModifies toolbar group column gap for action plain group.
.pf-m-action-group-inline.pf-v6-c-toolbar__groupModifies toolbar group column gap for action inline group.
.pf-m-toggle-group.pf-v6-c-toolbar__groupThe .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-v6-c-toolbar__item, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__toggle, .pf-v6-c-toolbar__expandable-contentIndicates that the toggle group element is hidden. Required
aria-expanded="[true/false]".pf-v6-c-toolbar__toggle > .pf-v6-c-buttonIndicates that the expandable content is visible/hidden. Required
aria-controls="[id of expandable content]".pf-v6-c-toolbar__toggle > .pf-v6-c-buttonIdentifies the expanded content controlled by the toggle button. Required
id="[expandable-content_id]".pf-v6-c-toolbar__expandable-contentProvides a reference for toggle button description. Required

Responsive attributes

AttributeApplied toOutcome
aria-haspopup=true.pf-v6-c-toolbar__toggle > .pf-v6-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/hide][-on-[sm/md/lg/xl/2xl]].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item, .pf-v6-c-toolbar__expandable-contentModifies toolbar element visibility.
.pf-m-expanded.pf-v6-c-toolbar__expandable-content, .pf-v6-c-toolbar__toggleModifies the component for the expanded state.

Selected

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

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

Selected filters on desktop (not responsive)

Stacked

Stacked on desktop

Stacked on mobile (filters collapsed, expandable content expanded)

Primary background

Secondary background

No background

Sticky toolbar

Dynamic sticky toolbar

This example shows the use of .pf-m-sticky-base and .pf-m-sticky-stuck. .pf-m-sticky-stuck can be applied dynamically as the page has scrolled to only show sticky styles when the toolbar is “stuck” and floating above the content.

Vertical

<div class="pf-v6-c-toolbar pf-m-vertical" id="toolbar-vertical-example">
  <div class="pf-v6-c-toolbar__content">
    <div class="pf-v6-c-toolbar__content-section">
      <div class="pf-v6-c-toolbar__item">Item</div>
      <div class="pf-v6-c-toolbar__item">Item</div>
      <div class="pf-v6-c-toolbar__item">Item</div>
      <hr class="pf-v6-c-divider" />

      <div class="pf-v6-c-toolbar__group">
        <div class="pf-v6-c-toolbar__item">Item</div>
        <div class="pf-v6-c-toolbar__item">Item</div>
        <div class="pf-v6-c-toolbar__item">Item</div>
      </div>

      <hr class="pf-v6-c-divider" />
      <div class="pf-v6-c-toolbar__item">Item</div>
      <div class="pf-v6-c-toolbar__item">Item</div>
      <div class="pf-v6-c-toolbar__item">Item</div>
    </div>
  </div>
</div>

Vertical with height visibility breakpoints

Visibility can be set per breakpoint to show or hide items and groups based on viewport height.

<div
  class="pf-v6-c-toolbar pf-m-vertical"
  id="toolbar-vertical-height-toggle-example"
>
  <div class="pf-v6-c-toolbar__content">
    <div class="pf-v6-c-toolbar__content-section">
      <div class="pf-v6-c-toolbar__item">Item</div>
      <div class="pf-v6-c-toolbar__item">Item</div>
      <div class="pf-v6-c-toolbar__item">Item</div>
      <hr class="pf-v6-c-divider" />

      <div class="pf-v6-c-toolbar__group">
        <div class="pf-v6-c-toolbar__item">Item</div>
        <div class="pf-v6-c-toolbar__item">Item</div>
        <div
          class="pf-v6-c-toolbar__item pf-m-hidden pf-m-visible-on-md-height"
        >Item (hidden below md)</div>
      </div>

      <hr class="pf-v6-c-divider" />

      <div class="pf-v6-c-toolbar__group pf-m-hidden pf-m-visible-on-lg-height">
        <div class="pf-v6-c-toolbar__item">Item (hidden below lg)</div>
        <div class="pf-v6-c-toolbar__item">Item (hidden below lg)</div>
        <div class="pf-v6-c-toolbar__item">Item (hidden below lg)</div>
      </div>
    </div>
  </div>
</div>

Documentation

Overview

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

Usage

ClassApplied toOutcome
.pf-v6-c-toolbar<div>Initiates the toolbar component. Required
.pf-v6-c-toolbar__item<div>Initiates a toolbar item. Required
.pf-v6-c-toolbar__group<div>Initiates a toolbar group.
.pf-v6-c-toolbar__content<div>Initiates a toolbar content container. Required
.pf-v6-c-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-v6-c-toolbar__content-section per .pf-v6-c-toolbar__content Required
.pf-v6-c-toolbar__expandable-content<div>Initiates a toolbar expandable content section.
.pf-v6-c-toolbar__expand-all-icon<div>Initiates a toolbar expand all icon.
.pf-m-sticky.pf-v6-c-toolbarModifies toolbar component to be sticky to the top of its container.
.pf-m-full-height.pf-v6-c-toolbar, .pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__groupModifies toolbar component to full height of its container and removes vertical padding.
.pf-m-static.pf-v6-c-toolbarModifies expandable content section to position itself to the nearest absolutely positioned parent outside of the toolbar component. This is used primarily for masthead toolbar.
.pf-m-primary.pf-v6-c-toolbarModifies toolbar to have primary background color.
.pf-m-secondary.pf-v6-c-toolbarModifies toolbar to have secondary background color.
.pf-m-no-padding.pf-v6-c-toolbarModifies toolbar to have no padding.
.pf-m-no-background.pf-v6-c-toolbarModifies toolbar to have no background color.
.pf-m-vertical.pf-v6-c-toolbarModifies toolbar for a vertical layout.
.pf-m-expanded.pf-v6-c-toolbar__expandable-contentModifies expandable content section for the expanded state.
.pf-m-expanded.pf-v6-c-toolbar__item.pf-m-expand-allModifies an expand all button for the expanded state.
.pf-m-action-group.pf-v6-c-toolbar__groupInitiates action group spacing.
.pf-m-action-group-inline.pf-v6-c-toolbar__groupInitiates inline action group spacing.
.pf-m-action-group-plain.pf-v6-c-toolbar__groupInitiates plain action group spacing.
.pf-m-filter-group.pf-v6-c-toolbar__groupInitiates filter group spacing.
.pf-m-label.pf-v6-c-toolbar__itemInitiates label item presenatation.
.pf-m-label-group.pf-v6-c-toolbar__groupInitiates label group spacing.
.pf-m-overflow-container.pf-v6-c-toolbar__item, .pf-v6-c-toolbar__groupModifies the toolbar element to hide overflow and respond to available space. Used for horizontal navigation.
.pf-m-expanded.pf-v6-c-toolbar__expandable-content, .pf-v6-c-toolbar__toggleModifies the component for the expanded state.
.pf-m-[wrap/nowrap].pf-v6-c-toolbar__content, .pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies the toolbar element to wrap/not wrap.
.pf-m-align-[start/center/end].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar main axis element alignment.
.pf-m-align-items-[stretch/baseline/start/center/end].pf-v6-c-toolbar__content, .pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar element cross axis child alignment.
.pf-m-align-self-[stretch/baseline/start/center/end].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar element cross axis self alignment.
.pf-m-inset-[none/sm/md/lg/xl/2xl].pf-v6-c-toolbarModifies toolbar horizontal.

Accessibility

AttributeApplied toOutcome
hidden.pf-v6-c-toolbar__item, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__toggle, .pf-v6-c-toolbar__expandable-contentIndicates that the toolbar element is hidden. Required
aria-expanded="[true/false]".pf-v6-c-toolbar__toggle > .pf-v6-c-buttonIndicates the the expandable content is hidden/visible. Required
aria-controls="[id of expandable content]".pf-v6-c-toolbar__toggle > .pf-v6-c-buttonIdentifies the expanded content controlled by the toggle button. Required
id="[expandable-content_id]".pf-v6-c-toolbar__expandable-contentProvides a reference for toggle button description. Required
aria-label="Expand all".pf-v6-c-toolbar__item.pf-m-expand-allProvides an accessible label for the expand all item button. Required
aria-label="Collapse all".pf-v6-c-toolbar__item.pf-m-expand-all.pf-m-expandedProvides an accessible label for the expand all item button. Required

Toggle group usage

ClassApplied toOutcome
.pf-m-toggle-group.pf-v6-c-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/hide].pf-v6-c-toolbar__group.pf-m-toggle-group, .pf-v6-c-toolbar__expandable-contentModifies toolbar element to hidden.

Spacer system

ClassApplied toOutcome
.pf-m-[column/row]-gap-[none/sm/md/lg/xl/2xl].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies toolbar group or item spacing at optional breakpoint.
.pf-m-gap-[none/sm/md/lg/xl/2xl].pf-v6-c-toolbar__group, .pf-v6-c-toolbar__itemModifies both column and row gap for toolbar group or item spacing at optional breakpoint.

CSS variables