An interactive panel that smoothly expands and collapses its content with a spring-like height and fade animation, built on Radix Collapsible and Motion.
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> ); }
Part of Animate UI — browse the full library on 21st.dev.