Murasaki
Components

Accordion

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

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@murasakijs/ui";
<Accordion type="single" collapsible>
  <AccordionItem value="item-1">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>
      Yes. It adheres to the WAI-ARIA design pattern.
    </AccordionContent>
  </AccordionItem>
</Accordion>

API Reference

Accordion

PropTypeDefault
type"single" | "multiple"— (required)
collapsibleboolean (only when type="single")false
value / defaultValuestring (single) or string[] (multiple)
onValueChange(value) => void

Other subcomponents

ComponentDescription
AccordionItemA single collapsible section. Accepts value (required).
AccordionTriggerThe clickable heading; renders a rotating chevron automatically.
AccordionContentThe collapsible panel, animated in/out via CSS.

The disclosure state, keyboard navigation, and ARIA relationships are provided by React Aria Components. Murasaki preserves the value-based API.

Improve this page on GitHub

On this page