BloksMoleculeAccordion

Accordion

Description

The Accordion component is a versatile and interactive UI element designed to display collapsible content, primarily used for FAQ-style information. It allows users to toggle between showing and hiding content sections, providing an efficient way to present large amounts of information in a compact, organized format. The component supports customizable themes and can be easily integrated into various page layouts.

Installation

bash
sabaccui add accordion

Usage

Here are examples of how to use the Accordion component in a Storyblok block:

Accordion with Dark Theme

Preview

Product Information

Accordion with Light Theme

Preview

Frequently Asked Questions

Schema

Field NameTypeDescriptionDefault Value
headertextThe title or header text for the accordion. This field is translatable.null
itemsbloksAn array of FAQ items to be displayed in the accordion. Only components of type "faq" are allowed.[]
themeoptionThe visual theme of the accordion. Options are "Light" or "Dark".null

Notes

  1. The Accordion component uses smooth animations for expanding and collapsing content, providing a polished user experience.
  2. The component is responsive and adapts well to different screen sizes.
  3. The Accordion is tagged as a "Molecule" component, indicating its role in the atomic design structure.
  4. The component supports Markdown content in the FAQ answers, allowing for rich text formatting.
  5. Ensure that FAQ questions are concise and clear to improve user navigation and understanding.
  6. The Accordion can be nested within other components, providing flexibility in page layout and content organization.
  7. The Accordion uses SchemaOrg markup for SEO optimization, enhancing search engine visibility for FAQ content.

When implementing this component, consider the following best practices:

  • Keep questions concise and clear.
  • Provide comprehensive but concise answers.
  • Group related questions together for better user navigation.
  • Use the theme that best matches your overall design and improves readability.
  • Avoid overloading the accordion with too many items, as it may become overwhelming for users.