Skip to content

PraxisAccordion

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

Usage

vue
<script setup>
import { PraxisAccordion } from 'praxis-vue-ui'

const panels = [
  { id: 'info', header: 'Patient Information', content: 'Name, DOB, ID...' },
  { id: 'contact', header: 'Contact Details', content: 'Phone, Email...' },
  { id: 'medical', header: 'Medical History', content: 'Diagnoses...' },
]
</script>

<template>
  <PraxisAccordion :panels="panels" />
</template>

Or with slot-based content:

vue
<PraxisAccordion>
  <template #header>Patient Information</template>
  <p>Name: Alice Johnson</p>
  <p>DOB: 1985-03-15</p>
</PraxisAccordion>

Props

PropTypeDefaultDescription
multiplebooleanfalseWhen true, multiple panels can be open simultaneously.
activeIndexnumber | number[]undefinedIndex or array of indexes of initially expanded panels.

Emits

EventPayloadDescription
update:activeIndexnumber | number[]Emitted when the active panel changes.
tab-open{ index: number }Emitted when a panel opens.
tab-close{ index: number }Emitted when a panel closes.

Built with VitePress