A panel that shows and hides with height motion you can reverse mid-way, without jumping the layout.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- cn
- @base-ui/react
- @tabler/icons-react
Code
import { Button } from "@/components/ui/button"
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
CollapsibleTriggerIcon,
} from "@/components/ui/collapsible"
export function CollapsibleDemo() {
return (
<Collapsible className="flex w-full max-w-sm flex-col gap-2">
<div className="flex items-center justify-between gap-4 ps-4">
<h4 className="text-sm font-semibold">
<span dir="ltr">@preetsuthar17</span> starred 3 repositories
</h4>
<CollapsibleTrigger
render={<Button variant="ghost" size="icon-sm" />}
aria-label="Toggle repositories"
>
<CollapsibleTriggerIcon />
</CollapsibleTrigger>
</div>
<div className="rounded-md border px-4 py-2 font-mono text-sm">
<span dir="ltr">@radix-ui/primitives</span>
</div>
<CollapsibleContent className="flex flex-col gap-2">
<div className="rounded-md border px-4 py-2 font-mono text-sm">
<span dir="ltr">@base-ui/react</span>
</div>
<div className="rounded-md border px-4 py-2 font-mono text-sm">
<span dir="ltr">@tabler/icons</span>
</div>
</CollapsibleContent>
</Collapsible>
)
}
































