--- title: Accordion description: A set of collapsible panels with headings. links: doc: https://base-ui.com/react/components/accordion#api-reference --- ## Preview ## Installation CLI Manual ```bash npx @olyx/cli@latest add accordion ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, } from "@/components/ui/accordion" ``` ```tsx Is it accessible? Yes. It adheres to the WAI-ARIA design pattern. ``` ## API Reference #### Accordion Root component. Alias for `Accordion.Root` from Base UI. #### AccordionItem Individual accordion item container. Styled wrapper for `Accordion.Item` from Base UI with bottom border styling. #### AccordionTrigger Trigger button that toggles the accordion panel. Styled wrapper for `Accordion.Trigger` from Base UI. Includes a built-in chevron icon that rotates when expanded. #### AccordionPanel Collapsible content panel. Styled wrapper for `Accordion.Panel` from Base UI with animated height transitions. Also exported as `AccordionContent`. ## Examples ### Single Accordion ### Multiple Accordion ### Controlled Accordion