Skip to content

Accordion ​

A vertically stacked set of interactive headings that each reveal a section of content.

Examples ​

Default ​

vue
<script setup>
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@empathyds/vue'
</script>

<Accordion type="single" collapsible>
  <AccordionItem value="item-1">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
  </AccordionItem>
  <AccordionItem value="item-2">
    <AccordionTrigger>Is it styled?</AccordionTrigger>
    <AccordionContent>Yes. It comes with default styles that matches the other components.</AccordionContent>
  </AccordionItem>
  <AccordionItem value="item-3">
    <AccordionTrigger>Is it animated?</AccordionTrigger>
    <AccordionContent>Yes. It's animated by default, but you can disable it if you prefer.</AccordionContent>
  </AccordionItem>
</Accordion>

Props ​

Accordion ​

PropTypeDefaultDescription
typestring-The type of accordion.
collapsiblebooleanfalseWhether an accordion item can be collapsed after it has been opened.
defaultValuestring | string[]-The default value of the item to expand.
disabledbooleanfalseWhen true, prevents the user from interacting with the accordion.
dirltr | rtlltrThe reading direction of the accordion.
orientationvertical | horizontalverticalThe orientation of the accordion.

Events ​

Accordion ​

EventPayloadDescription
update:modelValuestring | string[] | undefinedEvent handler called when the value changes.

AccordionItem ​

PropTypeDefaultDescription
valuestring-A unique value for the item.
disabledbooleanfalseWhen true, prevents the user from interacting with the item.

Slots ​

Accordion ​

SlotDescription
defaultThe content of the accordion.

AccordionTrigger ​

SlotDescription
defaultThe content of the trigger.

AccordionContent ​

SlotDescription
defaultThe content of the accordion item.