For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Collapsible

An interactive component which expands/collapses a panel.

@peduarte starred 3 repositories
@radix-ui/primitives
@base-ui/react
@stylexjs/stylex
"use client";

import { ChevronsUpDownIcon } from "lucide-react";

import { Button } from "@/components/button/button";
import {

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.vercel.app/r/collapsible.json

Usage

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

Composition

Use the following composition to build a Collapsible:

Collapsible
├── CollapsibleTrigger
└── CollapsibleContent

Examples

Settings Panel

Use a collapsible to progressively disclose advanced options.

Advanced settings
Email notifications
"use client";

import { ChevronsUpDownIcon } from "lucide-react";

import { Button } from "@/components/button/button";
import {

RTL

To enable right-to-left support, see the RTL guide.

الطلب #4189

الحالةتم الشحن
"use client";

import { ChevronsUpDown } from "lucide-react";
import * as React from "react";

import { useTranslation } from "@/components/language-selector";

API Reference

See the Base UI documentation for the full API.