Elliot Sutton

Base Collapsible

Component 1

About

An animated collapsible panel that smoothly expands and collapses its content with height and fade transitions when its trigger button is toggled.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Base Collapsible to your project and fits it to your theme.

Code

How Base Collapsible is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  Collapsible,
  CollapsiblePanel,
  CollapsibleTrigger,
} from "@/components/ui/base-collapsible";

export default function BaseCollapsibleDemo() {
  return (
    <Collapsible>
      <CollapsibleTrigger className="px-3 py-1.5 border-b text-start w-[200px]">
        Recovery keys
      </CollapsibleTrigger>
      <CollapsiblePanel>
        <div className="pt-1.5 px-3 text-sm text-muted-foreground">
          <div>alien-bean-pasta</div>
          <div>wild-irish-burrito</div>
          <div>horse-battery-staple</div>
        </div>
      </CollapsiblePanel>
    </Collapsible>
  );
}

Dependencies

More by Elliot Sutton

View all
  • Notification List

    Notification List

    210
  • Scroll Progress

    Scroll Progress

    137
  • Cursor

    Cursor

    126
  • Pin List

    Pin List

    108
  • Radix Dropdown Menu

    Radix Dropdown Menu

    100
  • Flip Button

    Flip Button

    96
  • Bubble Background

    Bubble Background

    92
  • Avatar Group

    Avatar Group

    83