Elliot Sutton

Base Collapsible

Component 5

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

    239
  • Glyph Background

    Glyph Background

    190
  • Scroll Progress

    Scroll Progress

    149
  • Cursor

    Cursor

    143
  • Topography Background

    Topography Background

    125
  • Pin List

    Pin List

    117
  • Bubble Background

    Bubble Background

    109
  • Avatar Group

    Avatar Group

    106