Examples

Hidden

Expanded

Indented

Disclosure variation (hidden)

Disclosure variation (expanded)

Disclosure variation (indented)

Detached

Truncate expansion (hidden)

Truncate expansion (expanded)

Documentation

Accessibility

AttributeApplied toOutcome
aria-expanded="true".pf-v6-c-expandable-section__toggle .pf-v6-c-buttonIndicates that the expandable section content is visible. Required
aria-expanded="false".pf-v6-c-expandable-section__toggle .pf-v6-c-buttonIndicates the the expandable section content is hidden. Required
hidden.pf-v6-c-expandable-section__contentIndicates that the expandable section content element is hidden. Use with aria-expanded="false" Required
aria-hidden="true".pf-v6-c-expandable-section__toggle-iconHides the icon from screen readers. Required
aria-controls="[id of content element]".pf-v6-c-expandable-section.pf-m-detached .pf-v6-c-expandable-section__toggle .pf-v6-c-buttonIdentifies the element controlled by the toggle button. Required
id.pf-v6-c-expandable-section.pf-m-detached .pf-v6-c-expandable-section__contentGives the content an id for use with aria-controls on .pf-v6-c-expandable-section__toggle .pf-v6-c-button. Required

Usage

ClassApplied toOutcome
.pf-v6-c-expandable-section<div>Initiates the expandable section component. Required
.pf-v6-c-expandable-section__toggle<div>Initiates the expandable toggle wrapper. Required
.pf-v6-c-expandable-section__toggle-icon<span>Initiates the expandable toggle icon. Required
.pf-v6-c-expandable-section__content<div>Initiates the expandable section content. Required
.pf-m-expanded.pf-v6-c-expandable-sectionModifies the component for the expanded state.
.pf-m-detached.pf-v6-c-expandable-sectionModifies the component for a detached variant.
.pf-m-expand-top.pf-v6-c-expandable-section__toggle-iconModifies the toggle icon to point up when expanded. We recommend the new method of applying this class directly to the .pf-v6-c-expandable-section wrapper element.
.pf-m-expand-top.pf-v6-c-expandable-section.pf-m-detachedModifies the expandable animation and icon rotation directions for detached expandable sections. Required when the content is above the toggle.
.pf-m-expand-bottom.pf-v6-c-expandable-section.pf-m-detachedModifies the expandable animation direction for detached expandable sections. Required when the content is below the toggle.
.pf-m-display-lg.pf-v6-c-expandable-sectionModifies the styling of the component to have large display styling.
.pf-m-indented.pf-v6-c-expandable-sectionIndicates that the expandable section content is indented and is aligned with the start of the title text to provide visual hierarchy.
.pf-m-truncate.pf-v6-c-expandable-sectionIndicates that the expandable section content is truncated by default, and not truncated when expanded.
--pf-v6-c-expandable-section--m-truncate__content--LineClamp.pf-v6-c-expandable-section.pf-m-truncateModifies the number of lines to show before truncating.

CSS variables