Skip to content
Star

PxAccordion

A collapsible accordion component. Renders one or more panels that expand/collapse on header click. Supports single or multiple active panels.

Usage

Demo

Without items, PxAccordion renders a single default scoped slot instead — build your own panel markup and call toggle/isOpen yourself:

Slot-based

Props

PropTypeDefaultDescription
itemsAccordionItem[]undefinedRenders panels programmatically (header/content pairs). Omit to use the default scoped slot instead.
multiplebooleanfalseWhen true, multiple panels can be open simultaneously.
valuestring | string[]undefinedValue (or array of values, if multiple) of initially expanded panel(s).

Slots

SlotPropsDescription
default{ isOpen, toggle }Rendered instead of items — isOpen(value) checks a panel's state, toggle(value) opens/closes it.

This component has no emits — it's fully uncontrolled; use the value prop only to set the initial state.

Built with VitePress