Skip to content

Accordion ​

Show and hide sections of content. Built on reka-ui's Accordion primitives — keyboard navigable, ARIA-compliant, follows the WAI-ARIA Accordion pattern.

Compose four pieces: Accordion (root, manages state), AccordionItem (each section, identified by value), AccordionTrigger (the clickable header), and AccordionContent (the collapsible body).

Single (one section open at a time) ​

EET, EPRA, GRI, INREV, GRESB, SECR, and UNPRI — plus any read-only or saved view in your workspace.

html
<Accordion type="single" collapsible default-value="reports">
  <AccordionItem value="reports">
    <AccordionTrigger>What reports does Scaler support?</AccordionTrigger>
    <AccordionContent>EET, EPRA, GRI, …</AccordionContent>
  </AccordionItem>
  <AccordionItem value="data">
    <AccordionTrigger>How is data persisted?</AccordionTrigger>
    <AccordionContent>Through the persistence adapter…</AccordionContent>
  </AccordionItem>
</Accordion>

Multiple (several open at a time) ​

What this guide covers and who it's for.

How to install and integrate the package.

html
<Accordion type="multiple" :default-value="['intro', 'usage']">
  <AccordionItem value="intro">
    <AccordionTrigger>Introduction</AccordionTrigger>
    <AccordionContent>…</AccordionContent>
  </AccordionItem>
  <AccordionItem value="usage">
    <AccordionTrigger>Usage</AccordionTrigger>
    <AccordionContent>…</AccordionContent>
  </AccordionItem>
</Accordion>

Disabled item ​

html
<AccordionItem value="locked" disabled>
  <AccordionTrigger>Locked section</AccordionTrigger>
  <AccordionContent>…</AccordionContent>
</AccordionItem>

Controlled ​

Bind model-value for full control over which items are open.

html
<Accordion type="single" v-model:model-value="open">
  <AccordionItem value="intro">…</AccordionItem>
  <AccordionItem value="usage">…</AccordionItem>
</Accordion>

open is Ref<string> for type="single" and Ref<string[]> for type="multiple".

Show / hide hints ​

AccordionTrigger accepts showHintLabel and hideHintLabel to surface a contextual hint that swaps based on the open state. Useful when the chevron alone doesn't communicate enough ("Show details" / "Hide details").

html
<AccordionTrigger show-hint-label="Show" hide-hint-label="Hide">
  Performance details
</AccordionTrigger>

Custom trigger icon ​

Replace the default chevron via the trigger's icon slot.

html
<AccordionTrigger>
  Custom Icon Example
  <template #icon>
    <Icon name="plus" :size="20" />
  </template>
</AccordionTrigger>

Accordion — Props ​

PropTypeDefaultDescription
type'single' | 'multiple'requiredOpen one item at a time, or many.
modelValuestring | string[]—Two-way bound open value(s). For type="single" use string; for type="multiple" use string[].
defaultValuestring | string[]—Initial open value(s) when uncontrolled.
collapsiblebooleanfalse(single only) Allow closing the currently-open item.
disabledbooleanfalseDisable the entire accordion.
dir'ltr' | 'rtl''ltr'Reading direction.
orientation'vertical' | 'horizontal''vertical'Layout orientation.

AccordionItem — Props ​

PropTypeDefaultDescription
valuestringrequiredIdentifier used by the parent Accordion's model-value.
disabledbooleanfalseDisable just this item.
classstring—Additional classes (merged via tailwind-merge).

AccordionTrigger — Props and Slots ​

PropTypeDefaultDescription
showHintLabelstring—Hint text rendered when the item is closed (e.g. "Show"). Hidden when open.
hideHintLabelstring—Hint text rendered when the item is open (e.g. "Hide"). Hidden when closed.
classstring—Additional classes for the trigger.
SlotDescription
defaultThe trigger label content.
iconCustom icon to replace the default rotating chevron.

AccordionTrigger also forwards reka-ui's AccordionTriggerProps.

AccordionContent — Props and Slots ​

PropTypeDefaultDescription
classstring—Additional classes for the inner padded wrapper.
SlotDescription
defaultBody content shown when the item is expanded.

AccordionContent also forwards reka-ui's AccordionContentProps.

Events ​

EventDescription
update:modelValueEmitted when the open state changes.

Accordion extends reka-ui's AccordionRoot props — see reka-ui Accordion docs for the full underlying API including onValueChange, focus management, etc.