Introducing PrimeReact v11-alpha 🎉Discover Now
styledPanel

Accordion

Accordion groups content into collapsible panels.

preview

Usage#

import { Accordion } from '@primereact/ui/accordion';
<Accordion.Root>
    <Accordion.Panel>
        <Accordion.Header>
            <Accordion.Trigger>
                <Accordion.Indicator />
            </Accordion.Trigger>
        </Accordion.Header>
        <Accordion.Content />
    </Accordion.Panel>
</Accordion.Root>

Examples#

Basic#

A simple accordion with expandable panels controlled via the value prop.

basic-demo

Multiple#

Each Accordion.Panel should define a unique value. By default, a single panel is open at a time. Enable multiple on Accordion.Root to allow multiple panels to stay open.

multiple-demo

Controlled#

Control the active panel state with value and onValueChange.

This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics.

controlled-demo

Trigger#

Use Accordion.Trigger to toggle content visibility. You can customize it with a render function that receives accordionpanel, or style it using data-content-open.

Is my data secure?
trigger-demo

Indicator#

Accordion.Indicator supports conditional rendering based on panel state. Use the match prop to render content only when the state matches.

<Accordion.Header>
    <Accordion.Trigger>
        <Accordion.Indicator match="open">
            <Minus />
        </Accordion.Indicator>
        <Accordion.Indicator match="closed">
            <Plus />
        </Accordion.Indicator>
    </Accordion.Trigger>
</Accordion.Header>

Available values: open, closed. Without the match prop, the indicator renders in all states.

Match open / closed

CSS-only with data attributes

indicator-demo

Disabled#

Set disabled on an Accordion.Panel to disable only that panel, or set it on Accordion.Root to disable all panels.

disabled-demo

Template#

Create accordion panels dynamically by iterating over a data source to keep structure consistent and reusable.

template-demo

With RadioButton#

RadioButton component can be used to group multiple Accordion.Panel components.

Starter Plan
$99

Perfect for individuals getting started. Includes access to core components and community support.

Growth Plan
$249
Scale Plan
$499
with-radiobutton-demo

API#

Sub-Components#

See Primitive API for AccordionRoot, AccordionPanel, AccordionHeader, AccordionTrigger, AccordionContent, and AccordionIndicator component documentation.

Hooks#

See Headless API for useAccordion and useAccordionPanel hook documentation.

Accessibility#

See Accordion Primitive for WAI-ARIA compliance details and keyboard support.