Veil UI
Components

Accordion

Vertically stacked disclosure panels built on Radix Accordion.

Installation

$ npx veil-ui@latest add accordion

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion";

<Accordion type="single" collapsible>
  <AccordionItem value="one">
    <AccordionTrigger>First panel</AccordionTrigger>
    <AccordionContent>First content</AccordionContent>
  </AccordionItem>
</Accordion>;

Examples

Single

Multiple

Default open

You can update your payment method at any time.

API reference

  • Accordion requires type="single" or type="multiple"; single mode accepts collapsible.
  • AccordionTrigger renders inside a heading wrapper with a rotating chevron.
  • AccordionContent animates its measured height between open and closed states using the animate-accordion-down / animate-accordion-up utilities from the shipped motion layer.

Accessibility

  • Triggers are buttons with aria-expanded and aria-controls managed by Radix.
  • Up and Down arrows move between triggers; Home and End jump to the edges.
  • Each panel is labelled by its trigger through aria-labelledby.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add accordion --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { AccordionContent } from "reka-ui";

import { cn } from "@/lib/utils";

const props = defineProps<{ class?: string }>();
</script>

<template>
  <AccordionContent
    data-slot="accordion-content"
    class="overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up"
  >
    <div :class="cn('pb-4 text-sm text-muted-foreground', props.class)">
      <slot />
    </div>
  </AccordionContent>
</template>

On this page