HTML

Select

ExamplesDocumentationUsageUsageDocumentationCSS Variables

Examples

Single

Disabled

Single expanded

Single with top expanded

The top select variation should be used when you want the menu to display above the toggle.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates a custom select.
.pf-c-select__toggle<button>Initiates a custom toggle.
.pf-c-select__toggle-wrapper<div>Initiates a custom select toggle wrapper.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.
.pf-c-select__menu<ul>Initiates the custom select dropdown menu.
.pf-c-select__menu-item<li>Initiates the items in the custom select dropdown menu.
.pf-c-select__menu-item-icon<i>Initiates the selected item icon.
.pf-m-top.pf-c-selectModifies the select menu to display above the toggle.

Single expanded and selected

The single select should be used when the user is selecting an option from a list of items. Although the presentation is similar to the basic dropdown, the underlying HTML and ARIA tag structure is specific to a select list. The selection will replace the default text in the toggle. The selection is highlighted with the list is opened. If the selection is cleared elsewhere (i.e. from the filter bar), the default text is restored.

Accessibility

AttributeApplied toOutcome
aria-selected="true".pf-c-select__menu-itemShould be set programmatically to indicate the active item.
disabled.pf-c-select__toggleDisables the dropdown toggle and removes it from keyboard focus.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<button>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.
.pf-c-select__menu<ul>Initiates the select dropdown menu.
.pf-c-select__menu-item<li>Initiates the items in the select dropdown menu.
.pf-c-select__menu-item-icon<i>Initiates the selected item icon.
.pf-m-expanded.pf-c-selectIndicates the select is expanded.
.pf-m-selected.pf-c-select__menu-itemIndicates the menu item is selected.
.pf-m-disableddiv.pf-c-select__toggleModifies to display the select toggle as disabled. This applies to div.pf-c-select__toggle and should not be used in lieu of the disabled attribute on button.pf-c-select__toggle. When this is used, disabled should also be added to any form elements in div.pf-c-select__toggle

Documentation

Accessibility

AttributeApplied toOutcome
aria-selected="true".pf-c-select__menu-itemShould be set programmatically to indicate the active item.
disabled.pf-c-select__toggleDisables the dropdown toggle and removes it from keyboard focus.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<button>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.
.pf-c-select__menu<ul>Initiates the select dropdown menu.
.pf-c-select__menu-item<li>Initiates the items in the select dropdown menu.
.pf-c-select__menu-item-icon<i>Initiates the selected item icon.
.pf-m-expanded.pf-c-selectIndicates the select is expanded.
.pf-m-selected.pf-c-select__menu-itemIndicates the menu item is selected.
.pf-m-disableddiv.pf-c-select__toggleModifies to display the select toggle as disabled. This applies to div.pf-c-select__toggle and should not be used in lieu of the disabled attribute on button.pf-c-select__toggle. When this is used, disabled should also be added to any form elements in div.pf-c-select__toggle

Single with typeahead

Single with typeahead expanded

Single with typeahead expanded and selected

The single select typeahead should be used when the user is selecting one option from a list of items with the option to narrow the list by typing from the keyboard. Selected items are removed from the list. The user can clear the selection and restore the placeholder text.

Accessibility

AttributeApplied toOutcome
aria-selected="true".pf-c-select__menu-itemShould be set programmatically to indicate the active item.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<div>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper.
.pf-c-select__toggle-typeaheadinput.pf-c-form-controlInitiates the input field for typeahead.
.pf-c-select__toggle-clearbutton.pf-c-button.pf-m-plainInitiates a clear button in the toggle.
.pf-c-select__toggle-buttonbutton.pf-c-button.pf-m-plainInitiates a toggle button.
.pf-c-select__toggle-arrow<i>Initiates the caret icon.
.pf-c-select__menu<ul>Initiates the select dropdown menu.
.pf-c-select__menu-item<li>Initiates the items in the select dropdown menu.
.pf-m-expanded.pf-c-selectIndicates the select is expanded.
.pf-m-typeahead.pf-c-select__toggleIndicates the select has a typeahead.

Select multi with typeahead

Multi with typeahead (chip group expanded)

  • Arkansas
  • Massachusetts
  • New Mexico
  • Ohio
  • Washington

Multi with typeahead (chip group collapsed)

  • Arkansas
  • Massachusetts
  • New Mexico

The Dropdown Multi Select should be used when the user is selecting multiple items from a list. The user can narrow the list by typing from the keyboard. The List updates while typing. Selected items create a new chip and are removed from the list. The user may clear selections individually or all at once to restore the placeholder.

Accessibility

AttributeApplied toOutcome
aria-selected="true".pf-c-select__menu-itemShould be set programmatically to indicate the active item.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<div>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper so that chips and input field can wrap together.
.pf-c-chip<div>Initiates a chip. (See chip component for more details)
.pf-c-select__toggle-typeaheadinput.pf-c-form-controlInitiates the input field for typeahead.
.pf-c-select__toggle-clearbutton.pf-m-plainInitiates a clear button in the toggle.
.pf-c-select__toggle-button<button>Initiates a toggle button.
.pf-c-select__toggle-arrow<i>Initiates the caret icon.
.pf-c-select__menu<ul>Initiates the select dropdown menu.
.pf-c-select__menu-item<li>Initiates the items in the select dropdown menu.
.pf-m-expanded.pf-c-selectIndicates the select is expanded.
.pf-m-typeahead.pf-c-select__toggleIndicates the select has a typeahead.

Checkbox

Checkbox expanded

Checkbox expanded and selected with groups

The checkbox select can select multiple items using checkboxes. The number of items selected is reflected in a badge in the dropdown toggle. The user may clear items by unchecking or using the clear button. Optionally, items may be grouped.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<button>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper so that chips and input field can wrap together.
.pf-c-chip<div>Initiates a chip. (See chip component for more details)
.pf-c-select__toggle-typeaheadinput.pf-c-form-controlInitiates the input field for typeahead.
.pf-c-select__toggle-badge<div>Initiates a container for a badge to indicate the number of items checked. note: This should contain an unread badge
.pf-c-select__toggle-clearbutton.pf-m-plainInitiates a clear button in the toggle.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.
.pf-c-select__menu<div>Initiates the select dropdown menu.
.pf-c-select__menu-itemdiv.pf-c-checkInitiates the items in the select dropdown menu.
.pf-c-select__menu-fieldset<fieldset>Initiates a fieldset for the items in a checkbox select.
.pf-c-select__menu-group<div>Initiates a group within a select menu.
.pf-c-select__menu-group-title<div>Initiates a title for a group with a select menu.
.pf-m-expanded.pf-c-selectIndicates the select is expanded.
.pf-m-typeahead.pf-c-select__toggleIndicates the select has a typeahead.

Plain

Plain expanded

The plain select variation should be used when you do not want a border applied to the select toggle.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<button>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.
.pf-c-select__menu<ul>Initiates the select dropdown menu.
.pf-c-select__menu-item<li>Initiates the items in the select dropdown menu.
.pf-c-select__menu-item-icon<i>Initiates the selected item icon.
.pf-m-expanded.pf-c-selectIndicates the select is expanded.
.pf-m-plain.pf-c-select__toggleModifies to display the toggle with no border.
.pf-m-selected.pf-c-select__menu-itemIndicates the menu item is selected.

Icon

Accessibility

AttributeApplied toOutcome
aria-hidden="true".pf-c-select__toggle-iconHides the icon from assistive technologies.

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<button>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper.
.pf-c-select__toggle-icon<span>Initiates the icon in the dropdown toggle.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.

Panel

[Panel contents here]

Usage

ClassApplied toOutcome
.pf-c-select<div>Initiates the select component.
.pf-c-select__toggle<button>Initiates the select toggle.
.pf-c-select__toggle-wrapper<div>Initiates the select toggle wrapper.
.pf-c-select__toggle-arrow<i>Initiates the caret to toggle the dropdown.
.pf-c-select__menu<div>Initiates the select dropdown menu.

Documentation

Overiew

There are 4 variants of the select component: single select, single select with typeahead, multiple select with typeahead, and a multiple checkbox select. See the examples for more details about each variation.

The single select should be used when the user is selecting an option from a list of items. Although the presentation is similar to the basic dropdown, the underlying HTML and ARIA tag structure is specific to a select list. The selection will replace the default text in the toggle. The selection is highlighted with the list is opened. If the selection is cleared elsewhere (i.e. from the filter bar), the default text is restored.

CSS Variables

--pf-c-select__menu--BackgroundColorc_select__menu_BackgroundColor
#fff
--pf-c-select__menu--BorderWidthc_select__menu_BorderWidth
1px
--pf-c-select__menu--BoxShadowc_select__menu_BoxShadow
0 0.0625rem 0.0625rem 0rem rgba(3,3,3,0.05),0 0.25rem 0.5rem 0.25rem rgba(3,3,3,0.06)
--pf-c-select__menu-group--not-first--PaddingTopc_select__menu_group_not_first_PaddingTop
0.5rem
--pf-c-select__menu-group-title--Colorc_select__menu_group_title_Color
#737679
--pf-c-select__menu-group-title--FontSizec_select__menu_group_title_FontSize
0.875rem
--pf-c-select__menu-group-title--FontWeightc_select__menu_group_title_FontWeight
700
--pf-c-select__menu-group-title--PaddingBottomc_select__menu_group_title_PaddingBottom
0.5rem
--pf-c-select__menu-group-title--PaddingLeftc_select__menu_group_title_PaddingLeft
1rem
--pf-c-select__menu-group-title--PaddingRightc_select__menu_group_title_PaddingRight
1rem
--pf-c-select__menu-group-title--PaddingTopc_select__menu_group_title_PaddingTop
0.5rem
--pf-c-select__menu-item--Colorc_select__menu_item_Color
#151515
--pf-c-select__menu-item--disabled--BackgroundColorc_select__menu_item_disabled_BackgroundColor
transparent
--pf-c-select__menu-item--disabled--Colorc_select__menu_item_disabled_Color
#737679
--pf-c-select__menu-item--FontSizec_select__menu_item_FontSize
1rem
--pf-c-select__menu-item--FontWeightc_select__menu_item_FontWeight
400
--pf-c-select__menu-item--hover--BackgroundColorc_select__menu_item_hover_BackgroundColor
#ededed
--pf-c-select__menu-item-icon--Colorc_select__menu_item_icon_Color
#06c
--pf-c-select__menu-item-icon--FontSizec_select__menu_item_icon_FontSize
0.625rem
--pf-c-select__menu-item-icon--Rightc_select__menu_item_icon_Right
1rem
--pf-c-select__menu-item-icon--Topc_select__menu_item_icon_Top
50%
--pf-c-select__menu-item-icon--Transformc_select__menu_item_icon_Transform
translateY(-50%)
--pf-c-select__menu-item--LineHeightc_select__menu_item_LineHeight
1.5
--pf-c-select__menu-item--m-selected--PaddingRightc_select__menu_item_m_selected_PaddingRight
3rem
--pf-c-select__menu-item--match--FontWeightc_select__menu_item_match_FontWeight
700
--pf-c-select__menu-item--PaddingBottomc_select__menu_item_PaddingBottom
0.5rem
--pf-c-select__menu-item--PaddingLeftc_select__menu_item_PaddingLeft
1rem
--pf-c-select__menu-item--PaddingRightc_select__menu_item_PaddingRight
3rem
--pf-c-select__menu-item--PaddingTopc_select__menu_item_PaddingTop
0.5rem
--pf-c-select__menu--m-top--Transformc_select__menu_m_top_Transform
translateY(calc(-100% - 0.25rem))
--pf-c-select__menu--PaddingBottomc_select__menu_PaddingBottom
0.5rem
--pf-c-select__menu--PaddingTopc_select__menu_PaddingTop
0.5rem
--pf-c-select__menu--Topc_select__menu_Top
calc(100% + 0.25rem)
--pf-c-select__menu--ZIndexc_select__menu_ZIndex
200
--pf-c-select__separator--BackgroundColorc_select__separator_BackgroundColor
#ededed
--pf-c-select__separator--Heightc_select__separator_Height
1px
--pf-c-select__separator--MarginBottomc_select__separator_MarginBottom
0.5rem
--pf-c-select__separator--MarginTopc_select__separator_MarginTop
0.5rem
--pf-c-select__toggle--active--BorderBottomColorc_select__toggle_active_BorderBottomColor
#06c
--pf-c-select__toggle--active--BorderBottomWidthc_select__toggle_active_BorderBottomWidth
2px
--pf-c-select__toggle-arrow--m-top--m-expanded__toggle-arrow--Transformc_select__toggle_arrow_m_top_m_expanded__toggle_arrow_Transform
rotate(180deg)
--pf-c-select__toggle-arrow--MarginLeftc_select__toggle_arrow_MarginLeft
1rem
--pf-c-select__toggle-arrow--MarginRightc_select__toggle_arrow_MarginRight
0.5rem
--pf-c-select__toggle-arrow--with-clear--MarginLeftc_select__toggle_arrow_with_clear_MarginLeft
0.5rem
--pf-c-select__toggle--BackgroundColorc_select__toggle_BackgroundColor
#ededed
--pf-c-select__toggle-badge--PaddingLeftc_select__toggle_badge_PaddingLeft
0.5rem
--pf-c-select__toggle--BorderBottomColorc_select__toggle_BorderBottomColor
#06c
--pf-c-select__toggle--BorderLeftColorc_select__toggle_BorderLeftColor
#ededed
--pf-c-select__toggle--BorderRightColorc_select__toggle_BorderRightColor
#ededed
--pf-c-select__toggle--BorderTopColorc_select__toggle_BorderTopColor
#ededed
--pf-c-select__toggle--BorderWidthc_select__toggle_BorderWidth
1px
--pf-c-select__toggle-button--Colorc_select__toggle_button_Color
#151515
--pf-c-select__toggle-button--PaddingLeftc_select__toggle_button_PaddingLeft
0.5rem
--pf-c-select__toggle-clear--PaddingLeftc_select__toggle_clear_PaddingLeft
1rem
--pf-c-select__toggle-clear--PaddingRightc_select__toggle_clear_PaddingRight
0.5rem
--pf-c-select__toggle--Colorc_select__toggle_Color
#151515
--pf-c-select__toggle--disabled--BackgroundColorc_select__toggle_disabled_BackgroundColor
#ededed
--pf-c-select__toggle--expanded--BorderBottomColorc_select__toggle_expanded_BorderBottomColor
#06c
--pf-c-select__toggle--expanded--BorderBottomWidthc_select__toggle_expanded_BorderBottomWidth
2px
--pf-c-select__toggle--FontSizec_select__toggle_FontSize
1rem
--pf-c-select__toggle--FontWeightc_select__toggle_FontWeight
400
--pf-c-select__toggle--hover--BorderBottomColorc_select__toggle_hover_BorderBottomColor
#06c
--pf-c-select__toggle-icon--toggle-text--MarginLeftc_select__toggle_icon_toggle_text_MarginLeft
0.25rem
--pf-c-select__toggle--LineHeightc_select__toggle_LineHeight
1.5
--pf-c-select__toggle--m-plain--BorderColorc_select__toggle_m_plain_BorderColor
transparent
--pf-c-select__toggle--m-plain--Colorc_select__toggle_m_plain_Color
#151515
--pf-c-select__toggle--m-plain--hover--Colorc_select__toggle_m_plain_hover_Color
#151515
--pf-c-select__toggle--MinWidthc_select__toggle_MinWidth
44px
--pf-c-select__toggle--PaddingBottomc_select__toggle_PaddingBottom
0
--pf-c-select__toggle--PaddingLeftc_select__toggle_PaddingLeft
0.5rem
--pf-c-select__toggle--PaddingRightc_select__toggle_PaddingRight
0
--pf-c-select__toggle--PaddingTopc_select__toggle_PaddingTop
0
--pf-c-select__toggle-typeahead--active--PaddingBottomc_select__toggle_typeahead_active_PaddingBottom
calc(0.375rem - 1px)
--pf-c-select__toggle-typeahead--BackgroundColorc_select__toggle_typeahead_BackgroundColor
transparent
--pf-c-select__toggle-typeahead--BorderLeftc_select__toggle_typeahead_BorderLeft
none
--pf-c-select__toggle-typeahead--BorderRightc_select__toggle_typeahead_BorderRight
none
--pf-c-select__toggle-typeahead--BorderTopc_select__toggle_typeahead_BorderTop
none
--pf-c-select__toggle-typeahead--FlexBasisc_select__toggle_typeahead_FlexBasis
10em
--pf-c-select__toggle-typeahead-form--MinWidthc_select__toggle_typeahead_form_MinWidth
7.5rem
--pf-c-select__toggle-wrapper--c-chip--c-button--PaddingBottomc_select__toggle_wrapper_c_chip_c_button_PaddingBottom
0.25rem
--pf-c-select__toggle-wrapper--c-chip--c-button--PaddingTopc_select__toggle_wrapper_c_chip_c_button_PaddingTop
0.25rem
--pf-c-select__toggle-wrapper--c-chip-group--MarginBottomc_select__toggle_wrapper_c_chip_group_MarginBottom
0.25rem
--pf-c-select__toggle-wrapper--c-chip-group--MarginTopc_select__toggle_wrapper_c_chip_group_MarginTop
0.5rem
--pf-c-select__toggle-wrapper--m-typeahead--PaddingTopc_select__toggle_wrapper_m_typeahead_PaddingTop
0
--pf-c-select__toggle-wrapper--MaxWidthc_select__toggle_wrapper_MaxWidth
calc(100% - 1.5rem)
--pf-c-select__toggle-wrapper--not-last-child--MarginRightc_select__toggle_wrapper_not_last_child_MarginRight
0.25rem