Make your AI a shadcn expert

Shadcn Accordion

React accordion for FAQ and settings sections. Built with TypeScript and Tailwind CSS for Next.js using Base UI — one or many panels, keyboard navigation.

The shadcn accordion is a stacked list of headings. Click a heading and the panel under it opens. Use it for FAQs, settings groups, and any page where the labels are enough to scan and the details can wait.

Scroll to load preview...

Looking for a neobrutalism version for shadcn?

Same accordion, thicker borders. The NeoBrutalism accordion is the kit if you want that look.

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion"
<Accordion defaultValue={["shipping"]}>
  <AccordionItem value="shipping">
    <AccordionTrigger>What are your shipping options?</AccordionTrigger>
    <AccordionContent>Standard is 5–7 days. Express is 2–3.</AccordionContent>
  </AccordionItem>
</Accordion>

defaultValue is a string[]. One panel starts open. Add multiple if several can stay open. Every AccordionItem needs a unique value. Switch Base / Radix / Aria on the preview — the APIs differ, the file still lands in components/ui.

Composition

AccordionTrigger
AccordionContent

Basic

One item at a time. The first one starts open.

Scroll to load preview...

Multiple

multiple — the value is a string[]. Two groups can stay open while someone compares them.

Scroll to load preview...

Disabled

disabled on AccordionItem greys out that row. The trigger stays in the list so the gap is obvious.

Scroll to load preview...

Borders

border on the Accordion, px-4 on each item. Same keyboard model, just a box around the list.

Scroll to load preview...

Card

Wrap it in a Card when the accordion is a section, not the whole page.

Scroll to load preview...

RTL

Wrap with DirectionProvider and dir="rtl". Triggers use text-start so the chevron stays on the end.

Scroll to load preview...

API

Prop

Type

AccordionItem

Prop

Type

AccordionTrigger and AccordionContent take className.

Keyboard

KeyAction
Space / EnterToggle the focused trigger
ArrowDown / ArrowUpMove to the next / previous trigger
Home / EndFirst / last trigger
TabLeave the accordion

Notes

Closed is hidden, not unmounted

Form fields inside a closed panel still submit with the form. Only render the fields while that value is open if they should not post.

Write the trigger as the question or the group name, not a sentence of explanation.

With other components

Questions

Was this page helpful?

Sign in to leave feedback.