Skip to main content

Accordion

An Accordion component is a collapsible structure used to organize and hide or reveal content, such as FAQs or detailed sections. Each accordion consists of AccordionItems that contain the actual content.

Example

Accordion header text

Accordion subheader text

Variants

The variants object allows you to customize the visual appearance of the accordion, such as padding, full-bleed, and text alignment.

Use theicon above to preview
VariantDescriptionValues
fullBleedBoolean that determines whether the accordion takes up the full width of its container.
  • true
  • false
paddingTopThe amount of space above the accordion.
  • regular
  • extra
paddingBottomThe amount of space below the accordion.
  • regular
  • extra
textPositionThe alignment of the accordion text
  • left
  • center
  • right

Accordion Configurations

FieldDescription
headerThe main title for the accordion.
subheaderOptional text to provide more information below the header.
accordionItemsArray of AccordionItem objects, each representing a collapsible accordion item.
openByDefaultBoolean that indicates if the accordion items should be open by default when loaded.
variantsConfiguration object for visual variants such as padding, alignment, and full-bleed.

Accordion Item

An AccordionItem is the collapsible content inside each accordion. It includes a header and content that is revealed when the item is expanded.

Accordion Item Configurations

FieldDescription
headerThe title for the accordion item. This text appears on the header of each item.
textThe text inside the accordion item. This is the text displayed when expanded.
mediaAssetsAn array of media items (images, videos) that can be shown inside the accordion item.
mediaBlocksOptional additional media content blocks inside the accordion item.

Usage Notes

  • Accordion supports multiple accordion items, which can be expanded or collapsed individually.
  • openByDefault allows you to control if all accordion items should be open on initial load.
  • AccordionItem allows embedding of text, media, and other content blocks.

Customization

The approach for customization will vary depending on if the customization is intended to be global for all consumers of the UI component or if it is only an override for a particular instance.

  • If the customization is necessary for all use cases, update the component source code in the UI library package directly.
  • Otherwise, pass className overrides to modify styles for a particular instance.