Collapsible
roi-ui/collapsibleFreeItem
An expandable/collapsible panel controlled by a button.
Install it
npx shadcn@latest add https://roiui.com/r/collapsible.jsonSource
1"use client";23import { Collapsible } from "@base-ui/react/collapsible";4import { cn } from "@/lib/utils";5import styles from "./collapsible.module.css";67function CollapsibleRoot({ className, ...props }: Collapsible.Root.Props) {8 return <Collapsible.Root className={cn(styles.root, className)} {...props} />;9}1011function CollapsibleTrigger({ className, children, ...props }: Collapsible.Trigger.Props) {12 return (13 <Collapsible.Trigger className={cn(styles.trigger, className)} {...props}>14 {children}15 <svg aria-hidden="true" className={styles.chevron} fill="none" height="16" viewBox="0 0 24 24" width="16">16 <path d="m7 15 5 5 5-5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />17 <path d="m7 9 5-5 5 5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />18 </svg>19 </Collapsible.Trigger>20 );21}2223function CollapsiblePanel({ className, ...props }: Collapsible.Panel.Props) {24 return <Collapsible.Panel className={cn(styles.panel, className)} data-slot="collapsible-panel" {...props} />;25}2627export { CollapsibleRoot as Collapsible, CollapsiblePanel, CollapsibleTrigger };
Files it writes
More from Roi UI
All 123 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Roi UI | Other | Free | no deps · 2 files | |
| Accordion (Tailwind)accordion-tailwind | Roi UI | Other | Free | no deps | |
| AI Chatai-chat | Roi UI | Other | Free | no deps · 2 files | |
| AI Chat (Tailwind)ai-chat-tailwind | Roi UI | Other | Free | no deps | |
| Alertalert | Roi UI | Other | Free | 1 dep · 2 files | |
| Alert Dialogalert-dialog | Roi UI | Other | Free | no deps · 2 files | |
| Alert Dialog (Tailwind)alert-dialog-tailwind | Roi UI | Other | Free | no deps | |
| Alert (Tailwind)alert-tailwind | Roi UI | Other | Free | 1 dep |
