Docs
Collapsible

Collapsible

An interactive component which expands/collapses a panel.

Loading...
Loading...

Installation

npx shadcn-ng@latest add collapsible
npm
yarn
pnpm
bun

Install the following dependencies:

npm install @radix-ng/primitives
npm
yarn
pnpm
bun

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

import {
  UbCollapsible,
  UbCollapsibleContent,
  UbCollapsibleTrigger
} from '@/components/ui/collapsible'
<div ubCollapsible>
  <button ubCollapsibleTrigger>Can I use this in my project?</button>
  <div ubCollapsibleContent>
    Yes. Free to use for personal and commercial projects. No attribution
    required.
  </div>
</div>