Chip

A chip is an annotation that displays a value or a set of attribute-value pairs that have been filtered within a data view.

Warning alert:Deprecated feature

This implementation has been deprecated in favor of a newer implementation, and is no longer getting maintained or enhanced. To learn more about the process, visit our about page.

Examples

Chip variants

Chips can be removable or read-only. The Overflow chip is a special chip that is used to expand or collapse the content of a chip group.

Chip 1

Really long chip that goes on and on

Chip 7

Read-only chip

Chip groups

A chip group is a collection of chips that can be grouped by category and used to represent one or more values assigned to a single attribute. When the value of numChips is exceeded, additional chips will be hidden using an overflow chip.

  • Chip one
  • Really long chip that goes on and on
  • Chip three

Chip groups with categories

  • Chip one
  • Really long chip that goes on and on
  • Chip three

Chip groups with removable categories

  • Chip one
  • Chip two
  • Chip three


  • Chip one
  • Chip two
  • Chip three

Props

Chip

*required
NameTypeDefaultDescription
badgeReact.ReactNodeBadge to add to the chip. The badge will be rendered after the chip text.
childrenReact.ReactNodeContent rendered inside the chip text
classNamestring''Additional classes added to the chip item
closeBtnAriaLabelstringAria Label for close button
Deprecated: componentReact.ReactNodeComponent that will be used for chip. It is recommended that <button> or <li> are used when the chip is an overflow chip.
isOverflowChipbooleanfalseFlag indicating if the chip is an overflow chip
isReadOnlybooleanfalseFlag indicating if chip is read only
onClick(event: React.MouseEvent) => void(_e: React.MouseEvent) => undefined as anyFunction that is called when clicking on the chip close button
ouiaIdnumber | stringValue to overwrite the randomly generated data-ouia-component-id.
textMaxWidthstring'16ch'Css property expressed in percentage or any css unit that overrides the default value of the max-width of the chip's text
tooltipPosition| TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end''top'Position of the tooltip which is displayed if text is longer

ChipGroup

*required
NameTypeDefaultDescription
aria-labelstring'Chip group category'Aria label for chip group that does not have a category name
categoryNamestring''Category name text for the chip group category. If this prop is supplied the chip group with have a label and category styling applied
childrenReact.ReactNodeContent rendered inside the chip group. Should be <Chip> elements.
classNamestringAdditional classes added to the chip item
closeBtnAriaLabelstring'Close chip group'Aria label for close button
collapsedTextstring'${remaining} more'Customizeable template string. Use variable "${remaining}" for the overflow chip count.
defaultIsOpenbooleanfalseFlag for having the chip group default to expanded
expandedTextstring'Show Less'Customizable "Show Less" text string
isClosablebooleanfalseFlag if chip group can be closed
numChipsnumber3Set number of chips to show before overflow
onClick(event: React.MouseEvent) => voidFunction that is called when clicking on the chip group close button or on an overflow chip
Deprecated: onOverflowChipClick(event: React.MouseEvent) => voidFunction that is called when clicking on the overflow (expand/collapse) chip button
ouiaIdnumber | stringValue to overwrite the randomly generated data-ouia-component-id.
tooltipPosition| TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end''top'Position of the tooltip which is displayed if the category name text is longer

CSS variables

Prefixed with 'pf-v5-c-chip'

Expand or collapse columnSelectorVariableValue

Prefixed with 'pf-v5-c-chip-group'

Expand or collapse columnSelectorVariableValue