Componentdata1.91 KB gzipZero dependencies
Collapsible
Standalone expandable disclosure card with notch header, animated height reveal and status mark.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add collapsibleOr install the full npm package:
npm install bigbulluiUsage
tsx13 lines
import { Collapsible } from "@/components/ui/collapsible"; <Collapsible title="VIP ADMISSION PASS" subtitle="Gate 4 · Section B · Row 12" serial="STUB #8841-A" status="valid" defaultOpen={false}> <p className="text-xs font-mono text-muted-foreground"> Admit one attendee to the main floor amphitheater with backstage lounge credentials. </p></Collapsible>Source code
collapsible.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcollapsible.tsx327 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type CollapsibleStatus = "valid" | "admitted" | "void" | "pending" | "vip"; export interface CollapsibleContextValue { open: boolean; toggle: () => void; setOpen: (open: boolean) => void; disabled?: boolean; contentId: string;} const CollapsibleCtx = React.createContext<CollapsibleContextValue | null>(null); export function useCollapsible(): CollapsibleContextValue {Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { useCollapsible } from "@/components/ui/collapsible"; <useCollapsible />| Prop | Type | Description |
|---|---|---|
| open | boolean | Controlled open visibility state. |
| defaultOpen | boolean | Initial open state when uncontrolled. (Default: false) |
| onOpenChange | (open: boolean) => void | Callback invoked on open change. |
| disabled | boolean | Disables interaction and applies disabled styling. (Default: false) |
| title | React.ReactNode | Primary heading or title text. |
| subtitle | React.ReactNode | Supporting secondary heading text. |
| serial | string | Configures serial. (Default: "STUB #08421") |
| badge | string | Configures badge. |
| status | CollapsibleStatus | Semantic status indicator. (Default: "valid") |
| stampText | string | Configures stamp text. |
| notch | boolean | Toggles notch. (Default: true) |