Componentdata1.91 KB gzipZero dependencies

Collapsible

Standalone expandable disclosure card with notch header, animated height reveal and status mark.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add collapsible

Or install the full npm package:

npm install bigbullui

Usage

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 helper

Zero 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 />
PropTypeDescription
openbooleanControlled open visibility state.
defaultOpenbooleanInitial open state when uncontrolled. (Default: false)
onOpenChange(open: boolean) => voidCallback invoked on open change.
disabledbooleanDisables interaction and applies disabled styling. (Default: false)
titleReact.ReactNodePrimary heading or title text.
subtitleReact.ReactNodeSupporting secondary heading text.
serialstringConfigures serial. (Default: "STUB #08421")
badgestringConfigures badge.
statusCollapsibleStatusSemantic status indicator. (Default: "valid")
stampTextstringConfigures stamp text.
notchbooleanToggles notch. (Default: true)