--- type: ai-agent-documentation version: 2.0 component: Accordion status: stable audience: ai-coding-agents-only human-readable: false category: layout framework-support: - vanilla: true - react: true - vue: true - angular: true - svelte: true --- # Component: Accordion DEFINITION: The Accordion component displays a list of collapsible content panels. It is used to organize and hide large amounts of content, revealing it only when needed. ## Installation ```bash npm install @pm7/core ``` ### CSS & JavaScript Import REQUIRED: Import both the CSS and the main JavaScript file. ```javascript // ES modules import '@pm7/core/dist/pm7.css'; import '@pm7/core'; // Imports and initializes all components // HTML ``` ## Required Structure An Accordion consists of a main container (`.pm7-accordion`) with `data-pm7-accordion`, and multiple accordion items. Each item contains a trigger (`.pm7-accordion-trigger`) and a content panel (`.pm7-accordion-content`). ```html
Accordion content goes here.
Content for section 1.
Content for section 2.
Content for section 1.
Open items: {openItems.join(', ')}