Docs
Collapsible

Collapsible

An interactive component which expands/collapses a panel.

🚧 Under development

Installation

Copy and paste the following code into your project.

"use client"
 
import { Collapsible as CollapsiblePrimitive } from "@base-ui-components/react/collapsible"
 
const Collapsible = CollapsiblePrimitive.Root
 
const CollapsibleTrigger = CollapsiblePrimitive.Trigger
 
const CollapsiblePanel = CollapsiblePrimitive.Panel
 
export { Collapsible, CollapsibleTrigger, CollapsiblePanel }

Update the import paths to match your project setup.

Usage

import {
  Collapsible,
  CollapsiblePanel,
  CollapsibleTrigger,
} from "@/components/ui/collapsible"
<Collapsible>
  <CollapsibleTrigger>Can I use this in my project?</CollapsibleTrigger>
  <CollapsibleContent>
    Yes. Free to use for personal and commercial projects. No attribution
    required.
  </CollapsibleContent>
</Collapsible>