Examples
Props
Accordion
Name | Type | Default | Description |
---|---|---|---|
aria-label | string | '' | Adds accessible text to the Accordion |
asDefinitionList | boolean | true | Flag to indicate whether use definition list or div |
children | React.ReactNode | null | Content rendered inside the Accordion |
className | string | '' | Additional classes added to the Accordion |
displaySize | 'default' | 'large' | 'default' | Display size variant. |
headingLevel | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h3' | Heading level to use |
isBordered | boolean | false | Flag to indicate the accordion had a border |
AccordionItem
Name | Type | Default | Description |
---|---|---|---|
children | React.ReactNode | null | Content rendered inside the Accordion item |
AccordionContent
Name | Type | Default | Description |
---|---|---|---|
aria-label | string | '' | Adds accessible text to the Accordion content |
children | React.ReactNode | null | Content rendered inside the Accordion |
className | string | '' | Additional classes added to the Accordion content |
component | React.ElementType | Component to use as content container | |
id | string | '' | Identify the AccordionContent item |
isCustomContent | React.ReactNode | false | Flag indicating content is custom. Expanded content Body wrapper will be removed from children. This allows multiple bodies to be rendered as content. |
isFixed | boolean | false | Flag to indicate Accordion content is fixed |
isHidden | boolean | false | Flag to show if the expanded content of the Accordion item is visible |
AccordionToggle
Name | Type | Default | Description |
---|---|---|---|
idrequired | string | Identify the Accordion toggle number | |
children | React.ReactNode | null | Content rendered inside the Accordion toggle |
className | string | '' | Additional classes added to the Accordion Toggle |
component | React.ElementType | Container to override the default for toggle | |
isExpanded | boolean | false | Flag to show if the expanded content of the Accordion item is visible |
AccordionExpandedContentBody
Name | Type | Default | Description |
---|---|---|---|
children | React.ReactNode | null | Content rendered inside the accordion content body |
CSS variables
.pf-c-accordion | --pf-global--Color--100 | #151515 | |
.pf-c-accordion | --pf-global--Color--200 | #6a6e73 | |
.pf-c-accordion | --pf-global--BorderColor--100 | #d2d2d2 | |
.pf-c-accordion | --pf-global--primary-color--100 | #06c | |
.pf-c-accordion | --pf-global--link--Color | #06c | |
.pf-c-accordion | --pf-global--link--Color--hover | #004080 | |
.pf-c-accordion | --pf-global--BackgroundColor--100 | #fff | |
.pf-c-accordion | --pf-c-accordion--BackgroundColor | #fff | |
.pf-c-accordion | --pf-c-accordion__toggle--PaddingTop | 0.5rem | |
.pf-c-accordion | --pf-c-accordion__toggle--PaddingRight | 1rem | |
.pf-c-accordion | --pf-c-accordion__toggle--PaddingBottom | 0.5rem | |
.pf-c-accordion | --pf-c-accordion__toggle--PaddingLeft | 1rem | |
.pf-c-accordion | --pf-c-accordion__toggle--before--BackgroundColor | transparent | |
.pf-c-accordion | --pf-c-accordion__toggle--before--Top | 0 | |
.pf-c-accordion | --pf-c-accordion__toggle--hover--BackgroundColor | #f0f0f0 | |
.pf-c-accordion | --pf-c-accordion__toggle--focus--BackgroundColor | #f0f0f0 | |
.pf-c-accordion | --pf-c-accordion__toggle--active--BackgroundColor | #f0f0f0 | |
.pf-c-accordion | --pf-c-accordion__toggle--before--Width | 3px | |
.pf-c-accordion | --pf-c-accordion__toggle--m-expanded--before--BackgroundColor | #06c | |
.pf-c-accordion | --pf-c-accordion__toggle-text--MaxWidth | calc(100% - 1.5rem) | |
.pf-c-accordion | --pf-c-accordion__toggle--hover__toggle-text--Color | #06c | |
.pf-c-accordion | --pf-c-accordion__toggle--active__toggle-text--Color | #06c | |
.pf-c-accordion | --pf-c-accordion__toggle--active__toggle-text--FontWeight | 700 | |
.pf-c-accordion | --pf-c-accordion__toggle--focus__toggle-text--Color | #06c | |
.pf-c-accordion | --pf-c-accordion__toggle--focus__toggle-text--FontWeight | 700 | |
.pf-c-accordion | --pf-c-accordion__toggle--m-expanded__toggle-text--Color | #06c | |
.pf-c-accordion | --pf-c-accordion__toggle--m-expanded__toggle-text--FontWeight | 700 | |
.pf-c-accordion | --pf-c-accordion__toggle-icon--Transition | .2s ease-in 0s | |
.pf-c-accordion | --pf-c-accordion__toggle--m-expanded__toggle-icon--Rotate | 90deg | |
.pf-c-accordion | --pf-c-accordion__expanded-content--Color | #6a6e73 | |
.pf-c-accordion | --pf-c-accordion__expanded-content--FontSize | 0.875rem | |
.pf-c-accordion | --pf-c-accordion__expanded-content--m-expanded__expanded-content-body--before--BackgroundColor | #06c | |
.pf-c-accordion | --pf-c-accordion__expanded-content--m-fixed--MaxHeight | 9.375rem | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--PaddingTop | 0.5rem | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--PaddingRight | 1rem | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--PaddingBottom | 0.5rem | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--PaddingLeft | 1rem | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--expanded-content-body--PaddingTop | 0 | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--before--BackgroundColor | transparent | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--before--Width | 3px | |
.pf-c-accordion | --pf-c-accordion__expanded-content-body--before--Top | 0 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--PaddingTop | 1rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--PaddingRight | 1rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--PaddingBottom | 1rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--PaddingLeft | 1.5rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--FontFamily | '"RedHatDisplay", "Overpass", overpass, helvetica, arial, sans-serif' | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--FontSize | 1.25rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--hover__toggle-text--Color | #151515 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--active__toggle-text--Color | #151515 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--active__toggle-text--FontWeight | 400 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--focus__toggle-text--Color | #151515 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--focus__toggle-text--FontWeight | 400 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--m-expanded__toggle-text--Color | #151515 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__toggle--m-expanded__toggle-text--FontWeight | 400 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content--FontSize | 1rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content--Color | #151515 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content-body--PaddingTop | 0 | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content-body--PaddingRight | 1rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content-body--PaddingBottom | 1rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content-body--last-child--PaddingBottom | 1.5rem | |
.pf-c-accordion | --pf-c-accordion--m-display-lg__expanded-content-body--PaddingLeft | 1.5rem | |
.pf-c-accordion | --pf-c-accordion--m-bordered--BorderTopWidth | 1px | |
.pf-c-accordion | --pf-c-accordion--m-bordered--BorderTopColor | #d2d2d2 | |
.pf-c-accordion | --pf-c-accordion--m-bordered__toggle--before--Top | calc(-1 * 1px) | |
.pf-c-accordion | --pf-c-accordion--m-bordered__toggle--after--BorderColor | #d2d2d2 | |
.pf-c-accordion | --pf-c-accordion--m-bordered__toggle--after--BorderTopWidth | 0 | |
.pf-c-accordion | --pf-c-accordion--m-bordered__toggle--after--BorderBottomWidth | 1px | |
.pf-c-accordion | --pf-c-accordion--m-bordered__expanded-content--m-expanded__expanded-content-body--last-child--after--BorderBottomWidth | 1px | |
.pf-c-accordion | --pf-c-accordion--m-bordered__expanded-content--m-expanded__expanded-content-body--last-child--after--BorderBottomColor | #d2d2d2 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--PaddingTop | 1rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--PaddingRight | 1rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--PaddingBottom | 1rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--PaddingLeft | 1.5rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--FontFamily | '"RedHatDisplay", "Overpass", overpass, helvetica, arial, sans-serif' | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--FontSize | 1.25rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--hover__toggle-text--Color | #151515 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--active__toggle-text--Color | #151515 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--active__toggle-text--FontWeight | 400 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--focus__toggle-text--Color | #151515 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--focus__toggle-text--FontWeight | 400 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--m-expanded__toggle-text--Color | #151515 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__toggle--m-expanded__toggle-text--FontWeight | 400 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__expanded-content-body--PaddingTop | 0 | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__expanded-content-body--PaddingRight | 1rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__expanded-content-body--PaddingBottom | 1rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__expanded-content-body--PaddingLeft | 1.5rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__expanded-content--FontSize | 1rem | |
.pf-c-accordion.pf-m-display-lg | --pf-c-accordion__expanded-content--Color | #151515 | |
.pf-c-accordion.pf-m-display-lg .pf-c-accordion__expanded-content-body:last-child | --pf-c-accordion__expanded-content-body--PaddingBottom | 1.5rem | |
.pf-c-accordion.pf-m-bordered | --pf-c-accordion__toggle--before--Top | calc(-1 * 1px) | |
.pf-c-accordion.pf-m-bordered .pf-c-accordion__toggle.pf-m-expanded | --pf-c-accordion--m-bordered__toggle--after--BorderBottomWidth | 0 | |
.pf-c-accordion__toggle.pf-m-expanded | --pf-c-accordion__toggle--before--BackgroundColor | #06c | |
.pf-c-accordion__expanded-content.pf-m-expanded | --pf-c-accordion__expanded-content-body--before--BackgroundColor | #06c | |
.pf-c-accordion__expanded-content-body + .pf-c-accordion__expanded-content-body | --pf-c-accordion__expanded-content-body--PaddingTop | 0 | |
View source on GitHub