Skip to Content
Patternfly Logo

Accordion

Accordions are used to deliver a lot of content in a small space, allowing the user to expand and collapse the component to show or hide information. In the collapsed state, the user will see the most important details about a topic. They can click on the accordion to expand the content area and view additional details.

ExamplesPropsCSS Variables

Examples

Definition list

Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam ultrices, faucibus erat id, maximus nunc.

Single expand behavior

Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam ultrices, faucibus erat id, maximus nunc.

Fixed with multiple expand behavior

Donec vel posuere orci. Phasellus quis tortor a ex hendrerit efficitur. Aliquam lacinia ligula pharetra, sagittis ex ut, pellentesque diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum ultricies nulla nibh. Etiam vel dui fermentum ligula ullamcorper eleifend non quis tortor. Morbi tempus ornare tempus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris et velit neque. Donec ultricies condimentum mauris, pellentesque imperdiet libero convallis convallis. Aliquam erat volutpat. Donec rutrum semper tempus. Proin dictum imperdiet nibh, quis dapibus nulla. Integer sed tincidunt lectus, sit amet auctor eros.

Props

Accordion properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Accordion
classNamestringNo''Additional classes added to the Accordion
aria-labelstringNo''Adds accessible text to the Accordion
headingLevel'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'No'h3'Heading level to use
asDefinitionListbooleanNotrueFlag to indicate whether use definition list or div
AccordionItem properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Accordion item
AccordionContent properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Accordion
classNamestringNo''Additional classes added to the Accordion content
idstringNo''Identify the AccordionContent item
isHiddenbooleanNofalseFlag to show if the expanded content of the Accordion item is visible
isFixedbooleanNofalseFlag to indicate Accordion content is fixed
aria-labelstringNo''Adds accessible text to the Accordion content
componentReact.ElementTypeNoComponent to use as content container
AccordionToggle properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Accordion toggle
classNamestringNo''Additional classes added to the Accordion Toggle
isExpandedbooleanNofalseFlag to show if the expanded content of the Accordion item is visible
idstringYesIdentify the Accordion toggle number
componentReact.ElementTypeNoContainer to override the default for toggle

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--BorderLeftColor
transparent
.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--m-expanded--BorderWidth
3px
.pf-c-accordion--pf-c-accordion__toggle--m-expanded--BorderLeftColor
#06c
.pf-c-accordion--pf-c-accordion__toggle-text--hover--Color
#06c
.pf-c-accordion--pf-c-accordion__toggle-text--hover--FontWeight
500
.pf-c-accordion--pf-c-accordion__toggle-text--active--Color
#06c
.pf-c-accordion--pf-c-accordion__toggle-text--active--FontWeight
500
.pf-c-accordion--pf-c-accordion__toggle-text--focus--Color
#06c
.pf-c-accordion--pf-c-accordion__toggle-text--focus--FontWeight
500
.pf-c-accordion--pf-c-accordion__toggle-text--expanded--Color
#06c
.pf-c-accordion--pf-c-accordion__toggle-text--expanded--FontWeight
500
.pf-c-accordion--pf-c-accordion__toggle-text--MaxWidth
calc(100% - 1.5rem)
.pf-c-accordion--pf-c-accordion__toggle-icon--LineHeight
1.5
.pf-c-accordion--pf-c-accordion__toggle-icon--Transition
.2s ease-in 0s
.pf-c-accordion--pf-c-accordion__toggle--m-expanded__toggle-icon--Transform
rotate(90deg)
.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--Color
#6a6e73
.pf-c-accordion--pf-c-accordion__expanded-content--FontSize
0.875rem
.pf-c-accordion--pf-c-accordion__expanded-content--BorderLeftColor
transparent
.pf-c-accordion--pf-c-accordion__expanded-content--m-expanded--BorderWidth
3px
.pf-c-accordion--pf-c-accordion__expanded-content--m-expanded--BorderLeftColor
#06c
.pf-c-accordion--pf-c-accordion__expanded-content--m-fixed--MaxHeight
9.375rem
.pf-c-accordion__toggle.pf-m-expanded--pf-c-accordion__toggle--BorderLeftColor
#06c
.pf-c-accordion__expanded-content.pf-m-expanded--pf-c-accordion__expanded-content--BorderLeftColor
#06c