Pace UI

Motion Collapsible

Component

About

A collapsible panel that expands and collapses with a smooth spring height animation and a mask-gradient edge reveal.

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

Code

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

Usage.tsx

"use client";

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

export default function CollapsibleDemo() {
  return (
    <div className="mx-auto w-full max-w-sm p-4">
      <Collapsible>
        <div className="flex items-center justify-between space-x-4 px-1">
          <h4 className="text-sm font-semibold">
            @base-ui starred 3 repositories
          </h4>
          <CollapsibleTrigger className="inline-flex size-8 shrink-0 items-center justify-center rounded-md border text-sm font-medium transition-colors hover:bg-muted">
            <svg
              xmlns="http://www.w3.org/2000/svg"
              width="16"
              height="16"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              strokeWidth="2"
              strokeLinecap="round"
              strokeLinejoin="round"
            >
              <path d="m7 15 5 5 5-5" />
              <path d="m7 9 5-5 5 5" />
            </svg>
            <span className="sr-only">Toggle</span>
          </CollapsibleTrigger>
        </div>
        <CollapsibleContent className="flex flex-col gap-2 pt-2">
          <div className="rounded-md border bg-card px-4 py-3 font-mono text-sm">
            @base-ui/react
          </div>
          <div className="rounded-md border bg-card px-4 py-3 font-mono text-sm">
            motion
          </div>
          <div className="rounded-md border bg-card px-4 py-3 font-mono text-sm">
            lucide-react
          </div>
        </CollapsibleContent>
      </Collapsible>
    </div>
  );
}

Dependencies

More by Pace UI

View all
  • Dot Loader

    Dot Loader

    960
  • Flip Reveal

    Flip Reveal

    669
  • Dot Flow

    Dot Flow

    267
  • Draw Line Text

    Draw Line Text

    119
  • Liquid Glass

    Liquid Glass

    62
  • Liquid Cursor

    Liquid Cursor

    51
  • Layered Stack

    Layered Stack

    46
  • Calendar Heatmap Chart

    Calendar Heatmap Chart

    10