Layout and structure

Accordion
v0.7.2
Ready for Production

A vertically stacked set of interactive headings that each reveal an associated section of content.

Prefer AI-assisted development?

This documentation is available via the Catalyst MCP Server. Learn how to connect →

Catalyst Accordion extends Radix UI Accordion with built-in design tokens and accessibility defaults, plus Tailwind-based styling — giving you a production-ready component with zero configuration.

Preview

Installation

npm install @pmi/catalyst-accordion
import {
  AccordionRoot,
  AccordionItem,
  AccordionHeader,
  AccordionTrigger,
  AccordionContent,
} from "@pmi/catalyst-accordion";

Add the Accordion Tailwind preset to your tailwind.config.ts:

import accordionPreset from "@pmi/catalyst-accordion/tailwind.config";

export default {
  presets: [accordionPreset],
  // ...
};

Common Patterns

Single

This example demonstrates a common composition pattern using a single accordion, where one item expands at a time. The same approach can also be adapted for multiple accordion items when needed. In AccordionRoot, add prop type="single". When type is single, use collapsible as true to allow closing content when clicking the trigger for an open item.

Preview

API Reference

AccordionRoot

The root container that manages the accordion group and its expansion mode.

Accepts all standard Radix Accordion Root props and forwards ref to the underlying Radix accordion root element.

Prop

Type

AccordionItem

A single collapsible section inside the accordion.

Accepts all standard Radix Accordion Item props and forwards ref to the underlying Radix accordion item element.

Prop

Type

AccordionHeader

The header wrapper that contains the trigger for each accordion item.

Accepts all standard Radix Accordion Header props and forwards ref to the underlying Radix accordion header element.

Prop

Type

AccordionTrigger

The interactive button that expands or collapses the associated content.

Accepts all standard Radix Accordion Trigger props and forwards ref to the underlying Radix accordion trigger element.

Prop

Type

AccordionContent

The collapsible panel that reveals the accordion item's content.

Accepts all standard Radix Accordion Content props and forwards ref to the underlying Radix accordion content element.

Prop

Type

See the Radix UI Accordion API for the full props reference.

Accessibility

Keyboard Interactions

KeyAction
ArrowDown / ArrowRightMoves focus to the next trigger in the accordion. Use ArrowDown for vertical accordions and ArrowRight for horizontal accordions.
ArrowUp / ArrowLeftMoves focus to the previous trigger in the accordion. Use ArrowUp for vertical accordions and ArrowLeft for horizontal accordions.
HomeMoves focus to the first accordion trigger.
EndMoves focus to the last accordion trigger.

ARIA

  • Catalyst adds role="region" to AccordionContent.
  • Accordion inherits its ARIA semantics from Radix: triggers are buttons with aria-expanded and aria-controls, and panel content is rendered as a labeled region.

See the Radix UI Accordion accessibility docs for inherited baseline behavior.

Choosing the Right Component

Use Accordion when you need to group related content into independently expandable sections while keeping the page scannable.

Reach for a different primitive when:

If you need…Use instead
A single show/hide section with less structureCollapsible
Peer panels that users switch between instead of expanding one below anotherTabs
Critical information that should always be visibleAlert
Multi-step progression or ordered completion flowStepper
  • Collapsible - For show/hide sections that can be expanded independently.
  • Tabs - For peer panels the user switches between instead of expanding content.

On this page