All components
Card Accordion Plus Minus
accordionsOrigin UI component.
responsive · 540px
Install
Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:
$
npx shadcn@latest add https://your-domain/r/comp-345.jsonUsage
import Cmp from "@/registry/origin-ui/comp-345";
export default function Demo() {
return <Cmp />;
}Component source
import { PlusIcon } from "lucide-react";
import { Accordion as AccordionPrimitive } from "radix-ui";
import {
Accordion,
AccordionContent,
AccordionItem,
} from "@/components/ui/accordion";
const items = [
{
content:
"coss ui focuses on developer experience and performance. Built with TypeScript, it offers excellent type safety, follows accessibility standards, and provides comprehensive documentation with regular updates.",
id: "1",
title: "What makes coss ui different?",
},
{
content:
"Use our CSS variables for global styling, or className and style props for component-specific changes. We support CSS modules, Tailwind, and dark mode out of the box.",
id: "2",
title: "How can I customize the components?",
},
{
content:
"Yes, with tree-shaking, code splitting, and minimal runtime overhead. Most components are under 5KB gzipped.",
id: "3",
title: "Is coss ui optimized for performance?",
},
{
content:
"All components follow WAI-ARIA standards, featuring proper ARIA attributes, keyboard navigation, and screen reader support. Regular testing ensures compatibility with NVDA, VoiceOver, and JAWS.",
id: "4",
title: "How accessible are the components?",
},
];
export default function Component() {
return (
<div className="space-y-4">
<h2 className="font-bold text-xl">Tabs w/ plus-minus</h2>
<Accordion
className="w-full space-y-2"
collapsible
defaultValue="3"
type="single"
>
{items.map((item) => (
<AccordionItem
className="rounded-md border bg-background px-4 py-1 outline-none last:border-b has-focus-visible:border-ring has-focus-visible:ring-[3px] has-focus-visible:ring-ring/50"
key={item.id}
value={item.id}
>
<AccordionPrimitive.Header className="flex">
<AccordionPrimitive.Trigger className="flex flex-1 items-center justify-between rounded-md py-2 text-left font-semibold text-[15px] leading-6 outline-none ocus-visible:ring-0 transition-all [&>svg>path:last-child]:origin-center [&>svg>path:last-child]:transition-all [&>svg>path:last-child]:duration-200 [&[data-state=open]>svg>path:last-child]:rotate-90 [&[data-state=open]>svg>path:last-child]:opacity-0 [&[data-state=open]>svg]:rotate-180">
{item.title}
<PlusIcon
aria-hidden="true"
className="pointer-events-none shrink-0 opacity-60 transition-transform duration-200"
size={16}
/>
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
<AccordionContent className="pb-2 text-muted-foreground">
{item.content}
</AccordionContent>
</AccordionItem>
))}
</Accordion>
</div>
);
}Source: Origin UI