Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Accordion for React and Tailwind

Open one panel or many. For FAQs, settings, and other disclosure UI.

Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.

Key features include advanced processing capabilities, and an intuitive user interface designed for both beginners and experts.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/accordion.json

Anatomy

Accordion anatomy: root, item, item trigger, item content, item indicator

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion";
<Accordion
  className="w-full max-w-lg"
  defaultValue={["item-1"]}
  lazyMount={false}
  unmountOnExit={false}
>
  <AccordionItem value="item-1">
    <AccordionTrigger>Product Information</AccordionTrigger>
    <AccordionContent className="flex flex-col gap-4 text-muted-foreground">
      <p>
        Our flagship product combines cutting-edge technology with sleek
        design. Built with premium materials, it offers unparalleled
        performance and reliability.
      </p>

      <p>
        Key features include advanced processing capabilities, and an
        intuitive user interface designed for both beginners and experts.
      </p>
    </AccordionContent>
  </AccordionItem>

  <AccordionItem value="item-2">
    <AccordionTrigger>Shipping Details</AccordionTrigger>
    <AccordionContent className="flex flex-col gap-4 text-muted-foreground">
      <p>
        We offer worldwide shipping through trusted courier partners. Standard
        delivery takes 3-5 business days, while express shipping ensures
        delivery within 1-2 business days.
      </p>

      <p>
        All orders are carefully packaged and fully insured. Track your
        shipment in real-time through our dedicated tracking portal.
      </p>
    </AccordionContent>
  </AccordionItem>

  <AccordionItem value="item-3">
    <AccordionTrigger>Return Policy</AccordionTrigger>
    <AccordionContent className="flex flex-col gap-4 text-muted-foreground">
      <p>
        We stand behind our products with a comprehensive 30-day return
        policy. If you&apos;re not completely satisfied, simply return the
        item in its original condition.
      </p>

      <p>
        Our hassle-free return process includes free return shipping and full
        refunds processed within 48 hours of receiving the returned item.
      </p>
    </AccordionContent>
  </AccordionItem>
</Accordion>

Accessibility

KeyDescription
Enter
Activate the focused control.
Space
Activate the focused control.
ArrowDown
Move to the next item when orientation is "vertical".
ArrowUp
Move to the previous item when orientation is "vertical".
ArrowRight
Move to the next item.
ArrowLeft
Move to the previous item.
Home
Move to the first item.
End
Move to the last item.

Demos

Card

Context

Controlled

Disabled

Horizontal

Item Context

Lazy Mount

Multiple

Non Collapsible

Root Provider

With Slider

API Reference

Accordion

div

PropType
AttributeType

AccordionItem

div

PropType
AttributeType

AccordionTrigger

button

PropType
AttributeType

AccordionContent

div

PropType
AttributeType
CSS variableType

AccordionItemIndicator

div

PropType
AttributeType

AccordionRootProvider

div

PropType
AttributeType

useAccordion

PropType

AccordionContext

PropType

AccordionItemContext

PropType