Skip to content

Accordion ​

A flexible accordion component for organizing collapsible content sections. Built with native <details> and <summary> elements for accessibility and progressive enhancement.

Selection Modes ​

Multiple (Default) ​

Allow multiple items to be expanded simultaneously.

Full width

Single ​

Only one item can be expanded at a time. Use single mode for mutually exclusive content.

Full width

Variants ​

Seven variants apply to all items through the parent accordion, including frost for translucent surfaces. Contained variants (solid, flat, and frost) keep an inset group surface and follow Cloud Four's nested-corner geometry: inner radius = max(0px, outer radius − padding − border width). With the default 12px outer radius and 8px padding, bordered solid and flat groups use 3px inner corners; borderless frost uses 4px. Only the first item's top corners and the last item's bottom corners are rounded; adjoining item corners stay square, including when expanded.

Full width

Frost Variant ​

frost gives accordion items a diffuse translucent surface with adaptive tint and backdrop blur.

Best Used With

Avoid nesting the accordion inside another translucent surface because stacked backdrop filters reduce contrast.

Full width

Sizes ​

Three sizes for different contexts.

Full width

Customization ​

Icons & Subtitles ​

Add icons or descriptive subtitles using slots. Use clear, descriptive titles to help users understand section content Overview.

Full width

States ​

Disabled ​

Prevent interaction with specific items.

Full width

API Reference ​

ore-accordion Attributes

AttributeTypeDefaultDescription
selection-mode'single' | 'multiple''multiple'Whether multiple items can be expanded simultaneously
variant'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text' | 'frost''solid'Visual variant applied to all items
size'sm' | 'md' | 'lg''md'Size applied to all items

ore-accordion-item Attributes

AttributeTypeDefaultDescription
expandedbooleanfalseWhether the item is expanded
disabledbooleanfalseDisable the item (prevents toggling)
variant'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text' | 'frost''solid'Visual variant (usually set via parent)
size'sm' | 'md' | 'lg''md'Size (usually set via parent)

Slots ​

ore-accordion-item

SlotDescription
(default)Content shown when item is expanded
titleTitle/summary content
subtitleSubtitle text shown below the title
prefixContent before the title (icons, etc.)
suffixContent after the title (badges, custom chevron, etc.)

Events ​

ore-accordion

EventDetailDescription
change{ expandedItem: HTMLElement | null }Emitted when selection changes (single mode only)

ore-accordion-item

EventDetailDescription
expand{ expanded: true, item: HTMLElement }Emitted when the item is expanded
collapse{ expanded: false, item: HTMLElement }Emitted when the item is collapsed

CSS Custom Properties ​

PropertyDescriptionDefault
--accordion-item-bgItem background colortransparent
--accordion-item-radiusItem border radius; contained parents subtract their padding and border from the group radiusvar(--rounded-lg)
--accordion-item-paddingItem inner paddingSize-dependent
--accordion-item-transitionTransition duration for expand/collapse animationvar(--transition-normal)
--accordion-border-colorContainer border color (solid/flat variants)Theme-dependent
--accordion-divider-colorDivider color between items (text variant)Theme-dependent
--accordion-shadowContainer box shadowTheme-dependent

Accessibility ​

The accordion component follows WAI-ARIA Accordion Pattern best practices. It is built with native <details> and <summary> elements, providing progressive enhancement: the component works without JavaScript. Keyboard navigation is fully supported: Enter and Space toggle expansion, and Tab moves focus between accordion items.

Content height transitions via grid-template-rows: 0fr → 1fr: no JavaScript height calculations and no layout thrashing. The transition respects prefers-reduced-motion and plays only when the user hasn't opted out of animations. The speed can be overridden with --accordion-item-transition.

Avoid hiding critical information in a collapsed state, and avoid nesting accordions more than one or two levels deep.