Default Accordion
shadcn-ui-blocks/accordion-01FreeComponent
A default accordion component
Install it
npx shadcn@latest add https://shadcnui-blocks.com/r/accordion-01.jsonSource
1import {2 Accordion,3 AccordionContent,4 AccordionItem,5 AccordionTrigger,6} from "@/registry/ui/accordion";78const items = [9 {10 title: "Can I change or cancel my order after placing it?",11 content:12 "Yes, you can change or cancel your order within 1 hour of placement by visiting your account page or contacting our support team. After that, orders may already be processed for shipping.",13 },14 {15 title: "How long does shipping usually take?",16 content:17 "Domestic shipping typically takes 3-5 business days, while international orders may take up to 2-3 weeks depending on your location and customs processing times.",18 },19 {20 title: "What is your return policy?",21 content:22 "We offer a 30-day return policy for most products. Items must be unused and in their original packaging. To initiate a return, simply contact our support with your order details.",23 },24];2526export default function AccordionDemo() {27 return (28 <Accordion className="my-4 w-full max-w-lg" collapsible type="single">29 {items.map(({ title, content }, index) => (30 <AccordionItem key={index} value={`item-${index}`}>31 <AccordionTrigger>{title}</AccordionTrigger>32 <AccordionContent>{content}</AccordionContent>33 </AccordionItem>34 ))}35 </Accordion>36 );37}
What it pulls in
Other registry items
Files it writes
More from Shadcn UI Blocks
All 542 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Outline Accordionaccordion-02 | Shadcn UI Blocks | Components | Free | no deps | |
| Box Accordionaccordion-03 | Shadcn UI Blocks | Components | Free | no deps | |
| Contained Accordionaccordion-04 | Shadcn UI Blocks | Components | Free | no deps | |
| Box Contained Accordionaccordion-05 | Shadcn UI Blocks | Components | Free | no deps | |
| Tabs Accordionaccordion-06 | Shadcn UI Blocks | Components | Free | no deps | |
| Highlight Active Item Accordionaccordion-07 | Shadcn UI Blocks | Components | Free | no deps | |
| Multiple Expanded at a time Accordionaccordion-08 | Shadcn UI Blocks | Components | Free | no deps | |
| Expand Icon Accordionaccordion-09 | Shadcn UI Blocks | Components | Free | 2 deps |
