ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β π shadcn/directory/cosscom/coss/components/accordion β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
title: Accordion description: A set of collapsible panels with headings.
<ComponentPreview name="accordion-demo" className="[&_.preview>[data-orientation=vertical]]:sm:max-w-[80%] **:[.preview]:min-h-[400px]" align="start" />
npx shadcn@latest add @coss/accordion
</TabsPanel>
<TabsPanel value="manual">
<Steps>
<Step>Install the following dependencies:</Step>
npm install @base-ui-components/react
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="accordion" title="components/ui/accordion.tsx" /><Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsPanel> </CodeTabs>import {
Accordion,
AccordionItem,
AccordionPanel,
AccordionTrigger,
} from "@/components/ui/accordion"
<Accordion>
<AccordionItem value="item-1">
<AccordionTrigger>Is it accessible?</AccordionTrigger>
<AccordionPanel>
Yes. It adheres to the WAI-ARIA design pattern.
</AccordionPanel>
</AccordionItem>
</Accordion>
<ComponentPreview name="accordion-single" className="[&_.preview>[data-orientation=vertical]]:sm:max-w-[80%] **:[.preview]:min-h-[400px]" align="start" />
<ComponentPreview name="accordion-multiple" className="[&_.preview>[data-orientation=vertical]]:sm:max-w-[80%] **:[.preview]:min-h-[400px]" align="start" />
<ComponentPreview name="accordion-controlled" className="[&_.preview>[data-orientation=vertical]]:sm:max-w-[80%] **:[.preview]:min-h-[400px]" align="start" />
If youβre already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with coss ui quickly.
| Component | Radix UI Prop | Base UI Prop |
| ----------- | ----------------------------------------- | ------------------------------------- |
| Accordion | type (enum, "single" or "multiple") | multiple (boolean, default: true) |
| Accordion | collapsible | removed |
type="single" β multiple={false} on Accordiontype="multiple" from Accordioncollapsible from AccordiondefaultValueAccordionPanel going forward; AccordionContent remains for legacyasChild on parts, switch to the render propβ β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ