Elliot Sutton

Base Collapsible

Component 4

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

    229
  • Scroll Progress

    Scroll Progress

    147
  • Glyph Background

    Glyph Background

    144
  • Cursor

    Cursor

    139
  • Pin List

    Pin List

    114
  • Bubble Background

    Bubble Background

    106
  • Topography Background

    Topography Background

    103
  • Radix Dropdown Menu

    Radix Dropdown Menu

    102