Skip to Content
Patternfly Logo

Chip group

A chip group is used to represent an attribute that has been assigned one or more values. An OR relationship is implied between values in the group. Chip groups are useful to express complex filters to a data set, for example. Related design guidelines: Filters

ExamplesPropsCSS Variables

Examples

Single

Chip 1


Really long Chip that goes on and on


Chip7


Read-only Chip

Toolbar

  • Category 1 has a very long name

    • Chip 1
    • Chip 2
  • Category 2

    • Chip 3
    • Chip 4
  • Category 3

    • Chip 5
    • Chip 6
    • Chip 7
    • Chip 8

Closable toolbar

  • Category 1

    • Chip 1
    • Chip 2
  • Category 2

    • Chip 3
    • Chip 4
  • Category 3

    • Chip 5
    • Chip 6
    • Chip 7
    • Chip 8

Multi select

  • Chip 1
  • Really long chip that goes on and on
  • Chip 3

Badge

  • Lemons10
  • Limes8

Props

Chip properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNoContent rendered inside the chip text
closeBtnAriaLabelstringNo'close'Aria Label for close button
classNamestringNo''Additional classes added to the chip item
isOverflowChipbooleanNofalseFlag indicating if the chip has overflow
isReadOnlybooleanNofalseFlag if chip is read only
onClick(event: React.MouseEvent) => voidNo(_e: React.MouseEvent) => undefined as anyFunction that is called when clicking on the chip button
componentReact.ReactNodeNo'div'Internal flag for which component will be used for chip
tooltipPosition'auto' | 'top' | 'bottom' | 'left' | 'right'No'top'Position of the tooltip which is displayed if text is longer
ChipGroup properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNoContent rendered inside the chip text
classNamestringNo''Additional classes added to the chip item
defaultIsOpenbooleanNofalseFlag for having the chip group default to expanded
expandedTextstringNo'Show Less'Customizable "Show Less" text string
collapsedTextstringNo'${remaining} more'Customizeable template string. Use variable "${remaining}" for the overflow chip count.
withToolbarbooleanNofalseFlag for grouping with a toolbar & category name
headingLevel'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'NoSet heading level to the chip item label
numChipsnumberNo3Set number of chips to show before overflow
ChipGroupToolbarItem properties
NameTypeRequiredDefaultDescription
categoryNamestringNo''Category name text
childrenReact.ReactNodeNonullContent rendered inside the chip text
classNamestringNo''Additional classes added to the chip item
isClosablebooleanNofalseFlag if chip group can be closed
onClick(event: React.MouseEvent) => voidNo(_e: React.MouseEvent) => undefined as anyFunction that is called when clicking on the chip group button
closeBtnAriaLabelstringNo'Close chip group'Aria label for close button
tooltipPosition'auto' | 'top' | 'bottom' | 'left' | 'right'No'top'Position of the tooltip which is displayed if the category name text is longer

CSS Variables

.pf-c-chip--pf-global--Color--100
#151515
.pf-c-chip--pf-global--Color--200
#6a6e73
.pf-c-chip--pf-global--BorderColor--100
#d2d2d2
.pf-c-chip--pf-global--primary-color--100
#06c
.pf-c-chip--pf-global--link--Color
#06c
.pf-c-chip--pf-global--link--Color--hover
#004080
.pf-c-chip--pf-global--BackgroundColor--100
#fff
.pf-c-chip--pf-c-chip--PaddingTop
0.375rem
.pf-c-chip--pf-c-chip--PaddingRight
0.5rem
.pf-c-chip--pf-c-chip--PaddingBottom
0.375rem
.pf-c-chip--pf-c-chip--PaddingLeft
0.5rem
.pf-c-chip--pf-c-chip--BackgroundColor
#fff
.pf-c-chip--pf-c-chip--BorderRadius
3px
.pf-c-chip--pf-c-chip--before--BorderColor
#f0f0f0
.pf-c-chip--pf-c-chip--before--BorderWidth
1px
.pf-c-chip--pf-c-chip--before--BorderRadius
3px
.pf-c-chip--pf-c-chip--m-overflow__text--Color
#06c
.pf-c-chip--pf-c-chip__text--FontSize
0.75rem
.pf-c-chip--pf-c-chip__text--Color
#151515
.pf-c-chip--pf-c-chip__text--MaxWidth
7.5rem
.pf-c-chip--pf-c-chip__c-button--PaddingLeft
0.5rem
.pf-c-chip--pf-c-chip__c-button--PaddingRight
0.5rem
.pf-c-chip--pf-c-chip__c-button--MarginTop
calc(0.375rem * -1)
.pf-c-chip--pf-c-chip__c-button--MarginRight
calc(0.5rem / 2 * -1)
.pf-c-chip--pf-c-chip__c-button--MarginBottom
calc(0.375rem * -1)
.pf-c-chip--pf-c-chip__c-button--FontSize
0.75rem
.pf-c-chip--pf-c-chip__c-badge--MarginLeft
0.25rem
.pf-c-chip .pf-c-button--pf-c-button--PaddingRight
0.5rem
.pf-c-chip .pf-c-button--pf-c-button--PaddingLeft
0.5rem
.pf-c-chip .pf-c-button--pf-c-button--FontSize
0.75rem