Skip to main content
Accordions organize related content into collapsible sections. Each section has a header that reveals or hides its panel content, helping people scan headings first and open only the information they need.
Use bq-accordion-group to wrap multiple bq-accordion items when you need to coordinate their behavior — for example, collapsing one when another opens.

At a glance

  • Best for: FAQs, advanced settings, grouped secondary information, and long pages where not every section needs to stay open.
  • Use with care: If people need to compare sections side by side or keep several sections visible while working, an accordion may add friction.
  • Related components: Use tabs when content belongs to a small set of peer views, or a simple show/hide pattern when only one section needs to expand.

When to use

Use accordions when
  • Related content can be grouped into clearly labeled sections
  • Page length or visual density needs to be reduced without removing content
  • People benefit from scanning headings before deciding what to open

Do not use accordions when
  • People need to compare content across sections at the same time
  • The content is short enough to show fully without harming readability
  • Most sections are likely to be opened during the same task

Anatomy

Accordion anatomy
Each accordion item includes a clickable header and a collapsible panel. The header should set clear expectations about what the panel contains.
PartElementDescription
1ContainerThe outer wrapper for the entire accordion item
2HeaderThe clickable trigger that toggles the panel open/closed
3PanelThe collapsible area containing the body content
4PrefixAn optional suffix like an icon or avatar before the header text for additional context
5SuffixAn optional prefix for additional context after the header text (less common than prefix)
6Expand/CollapseIcon indicating the current state of the panel and providing a visual affordance for interactivity

Design guidelines

Use accordions to reduce page density without hiding content that people need to complete the task. Keep each header specific, keep panel content focused, and use bq-accordion-group when several accordion items should behave as one coordinated set.

Usage

The examples below cover the most common ways to use accordions in BEEQ. Start with a single accordion item when sections are independent, and use an accordion group when items should behave as one coordinated set.

Default (collapsed)

Accordion items are collapsed by default. This works best when the heading alone gives enough context for someone to decide whether opening the section is worth it.

Expanded by default

Use the expanded attribute when a section should start open — for example when the first item contains the most important information or when one section is expected to be reviewed first.

Options

Appearance

Two appearance values are available:
  • filled: (default) adds a background color to the header for a contained look
  • ghost: removes the background for a minimal style that blends with surrounding content.
Since filled is the default, there’s no need to explicitly set appearance="filled" on the component.

Size

Accordions support two sizes: medium (default) and small. The small size uses more compact padding and a smaller border radius, giving it a tighter look.
Use the small size in dense layouts or sidebars where space is limited.

Group

Wrap related bq-accordion items inside bq-accordion-group when they should behave as a coordinated set. By default, only one item can stay open at a time. Add the multiple attribute when people may need to keep several sections open while reading or working. The group also lets you set appearance, size, and no-animation once and have them cascade to all child accordions.
Attributes/Properties set in the group can be overridden by setting them directly on an individual accordion item.

Single open (default group behavior)

Use the default group behavior when the sections are mutually exclusive or when keeping only one panel open helps reduce distraction.

Multiple open

Allow multiple sections to stay open when people may need to review, reference, or complete information across several panels at once.
Use expand-all attribute (expandAll prop) on the group to open every accordion simultaneously — useful for print views or when people need to scan all content at once.

Header slots

Use the prefix slot for adding elements like icons or avatars before the header text, and the suffix slot for elements after the text. These provide additional context to help people scan and understand the sections.

States

Disabled

Use disabled only when a section is temporarily unavailable. The header will not respond to interaction and the bqOpen / bqClose events will not fire.

Animation

By default, accordions animate the panel open and closed with a smooth height transition. Add the no-animation attribute to disable this and make the panel appear/disappear instantly.
Use no-animation when reduced motion is a concern, or as a fallback for users who have prefers-reduced-motion set. You can also set no-animation on bq-accordion-group to disable animation for all child accordions at once.

Custom expand/collapse icons

The accordion provides two separate slots — expand and collapse — to replace the default plus/minus icons. Use expand for the icon shown when the panel is closed and collapse for the icon shown when the panel is open. Alternatively, combine a single icon in the expand slot with the rotate prop, which rotates the icon 180° when the accordion opens.
When using a single custom icon with rotate, make sure the icon is designed to be recognizable in both orientations (e.g., a caret or arrow) and it’s place in the expand slot, as the rotation is applied to that icon when the accordion is expanded.

Custom header layout

Sometimes customizations are needed to meet some requirements. For example, having the collapse/expand indicator in front instead of at the end (current position). Developers can rely on the exposed shadow DOM parts of the components to target elements inside it and tweak not only the look & feel but also the layout.
In the example below, we define a custom CSS class that targets the header part to reverse the order of the header content and the expand icon, and also applies flexbox styles to space out the header content. Then, assuming the custom CSS file is imported in the project, we apply the custom class to the accordion to achieve the desired header layout.

Best practices

DoWrite header labels that clearly describe the content inside. People should be able to predict what they will find before opening the section.

Don’tDo not nest accordions inside accordion panels. It creates unclear hierarchy and makes interaction patterns harder to follow.

DoUse bq-accordion-group when items belong together and their open/close behavior should be coordinated.

Don’tDo not hide critical content inside accordions. If the information is essential to the page, it should usually remain visible.

DoConsider no-animation or a reduced-motion strategy for workflows where motion may distract or overwhelm.

Don’tDo not use an accordion when a simpler show/hide pattern or a tab group would communicate the structure more clearly.

DoKeep panel content focused on the promise made by the header so people can scan and decide quickly.

Don’tDo not use vague headers such as “More details” when a specific label would set clearer expectations.

Accessibility

  • Keyboard navigation — the header is a focusable button and can be activated with Enter or Space.
  • Clear headings — header labels should describe the panel content clearly enough to be understood before expansion.
  • ARIA support — the header exposes aria-expanded, and the panel visibility is reflected for assistive technologies.
  • Disabled state — disabled accordions are removed from the tab order, so use this state sparingly and explain unavailable content when possible.
  • Reduced motion — use no-animation when motion should be minimized, or respect the user’s prefers-reduced-motion setting.

API reference

bq-accordion properties

PropertyAttributeDescriptionTypeDefault
appearanceappearanceThe appearance style of the accordion'filled' | 'ghost''filled'
disableddisabledIf true, the accordion header is not interactivebooleanfalse
expandedexpandedIf true, the accordion panel is expandedbooleanfalse
noAnimationno-animationIf true, disables the open/close animationbooleanfalse
rotaterotateIf true, the expand icon rotates 180° when expanded instead of swappingbooleanfalse
sizesizeThe size of the accordion'small' | 'medium''medium'

bq-accordion-group properties

PropertyAttributeDescriptionTypeDefault
appearanceappearanceAppearance style applied to all child accordions'filled' | 'ghost''filled'
expandAllexpand-allIf true, all child accordions are expandedbooleanfalse
noAnimationno-animationIf true, disables animation on all child accordionsbooleanfalse
multiplemultipleIf true, multiple accordion items can be expanded at the same timebooleanfalse
sizesizeSize applied to all child accordions'small' | 'medium''medium'

Events

EventDescriptionType
bqBlurFires when the accordion loses focusCustomEvent<HTMLBqAccordionElement>
bqClickFires when the accordion header is clickedCustomEvent<HTMLBqAccordionElement>
bqFocusFires when the accordion gets focusCustomEvent<HTMLBqAccordionElement>
bqOpenFires when the accordion panel starts to openCustomEvent<HTMLBqAccordionElement>
bqAfterOpenFires after the open transition has completedCustomEvent<HTMLBqAccordionElement>
bqCloseFires when the accordion panel starts to closeCustomEvent<HTMLBqAccordionElement>
bqAfterCloseFires after the close transition has completedCustomEvent<HTMLBqAccordionElement>
  • In React, prefix events with on: onBqBlur, onBqClick, onBqFocus, onBqOpen, onBqClose, onBqAfterOpen, onBqAfterClose.
  • In Angular, use the event binding syntax: (bqBlur), (bqClick), (bqFocus), (bqOpen), (bqClose), etc.
  • In Vue, use the @ shorthand: @bq-blur, @bq-click, @bq-focus, @bq-open, @bq-close, etc.

Slots

bq-accordion

SlotDescription
(default)The panel body content shown when the accordion is expanded
collapseCustom icon shown when the accordion is expanded (clicking will collapse)
expandCustom icon shown when the accordion is collapsed (clicking will expand)
headerThe accordion header label (the clickable trigger)
prefixContent before the header text — icon or avatar
suffixContent after the header text — icon or status indicator

bq-accordion-group

SlotDescription
(default)One or more bq-accordion elements

Shadow parts

bq-accordion

PartDescription
baseThe <details> element wrapping the accordion
headerThe <summary> element — the clickable header
panelThe <div> containing the panel body content
prefixThe <div> wrapping the prefix slot content
suffixThe <div> wrapping the suffix slot content
textThe <div> wrapping the header text slot content

bq-accordion-group

PartDescription
baseThe wrapper <div> for the accordion group

CSS custom properties

Resources

Use Storybook to test behavior and states interactively, or review the source if you need implementation details.

Interactive playground

Explore all accordion configurations in Storybook

Source code

View the component source on GitHub