Elliot Sutton

Radix Collapsible

Component 3

About

An interactive panel that smoothly expands and collapses its content with a spring-like height and fade animation, built on Radix Collapsible and Motion.

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

Code

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

Usage.tsx

import {
  Collapsible,
  CollapsibleContent,
  CollapsibleTrigger,
} from "@/components/ui/radix-collapsible";

export default function RadixCollapsibleDemo() {
  return (
    <div className="flex min-h-[240px] w-full items-center justify-center">
      <Collapsible>
        <CollapsibleTrigger className="px-3 py-1.5 border-b text-start w-[200px]">
          Recovery keys
        </CollapsibleTrigger>
        <CollapsibleContent keepRendered={false}>
          <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>
        </CollapsibleContent>
      </Collapsible>
    </div>
  );
}

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