Elliot Sutton

Base Collapsible

Component 2

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

    220
  • Scroll Progress

    Scroll Progress

    142
  • Cursor

    Cursor

    130
  • Pin List

    Pin List

    111
  • Radix Dropdown Menu

    Radix Dropdown Menu

    101
  • Flip Button

    Flip Button

    98
  • Bubble Background

    Bubble Background

    95
  • Avatar Group

    Avatar Group

    92