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 VariablesExamples
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
Props
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | React.ReactNode | No | Content rendered inside the chip text | |
closeBtnAriaLabel | string | No | 'close' | Aria Label for close button |
className | string | No | '' | Additional classes added to the chip item |
isOverflowChip | boolean | No | false | Flag indicating if the chip has overflow |
isReadOnly | boolean | No | false | Flag if chip is read only |
onClick | (event: React.MouseEvent) => void | No | (_e: React.MouseEvent) => undefined as any | Function that is called when clicking on the chip button |
component | React.ReactNode | No | '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 |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | React.ReactNode | No | Content rendered inside the chip text | |
className | string | No | '' | Additional classes added to the chip item |
defaultIsOpen | boolean | No | false | Flag for having the chip group default to expanded |
expandedText | string | No | 'Show Less' | Customizable "Show Less" text string |
collapsedText | string | No | '${remaining} more' | Customizeable template string. Use variable "${remaining}" for the overflow chip count. |
withToolbar | boolean | No | false | Flag for grouping with a toolbar & category name |
headingLevel | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | No | Set heading level to the chip item label | |
numChips | number | No | 3 | Set number of chips to show before overflow |
Name | Type | Required | Default | Description |
---|---|---|---|---|
categoryName | string | No | '' | Category name text |
children | React.ReactNode | No | null | Content rendered inside the chip text |
className | string | No | '' | Additional classes added to the chip item |
isClosable | boolean | No | false | Flag if chip group can be closed |
onClick | (event: React.MouseEvent) => void | No | (_e: React.MouseEvent) => undefined as any | Function that is called when clicking on the chip group button |
closeBtnAriaLabel | string | No | '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 | ||