{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "fluid-modal-transition-shadcnui", "type": "registry:component", "title": "Fluid Modal Transition", "description": "Modal that expands smoothly from clicked trigger element using layoutId", "registryDependencies": [ "button" ], "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/motion-core/fluid-modal-transition.tsx", "content": "\"use client\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { X } from \"lucide-react\";\nimport React, { useEffect, useState } from \"react\";\n\ntype FluidModalTransitionProps = {\n trigger?: React.ReactNode;\n title?: string;\n children?: React.ReactNode;\n};\n\nexport function FluidModalTransition({\n trigger,\n title = \"Modal Title\",\n children,\n}: FluidModalTransitionProps) {\n const [isOpen, setIsOpen] = useState(false);\n\n // If no trigger provided, auto-open for preview\n useEffect(() => {\n if (!trigger) {\n setIsOpen(true);\n }\n }, [trigger]);\n\n return (\n <>\n {trigger ? (\n
setIsOpen(true)}>{trigger}
\n ) : (\n setIsOpen(true)}\n className=\"rounded-lg bg-primary px-4 py-2 text-primary-foreground\"\n >\n Open Modal\n \n )}\n\n \n {isOpen && (\n <>\n setIsOpen(false)}\n className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\"\n />\n\n
\n \n
\n

{title}

\n setIsOpen(false)}\n className=\"flex h-8 w-8 items-center justify-center rounded-full hover:bg-muted\"\n >\n \n \n
\n\n
\n {children || (\n
\n

\n This is a fluid modal transition. The modal expands\n smoothly from the trigger element.\n

\n

\n Click the X button to close.\n

\n
\n )}\n
\n \n
\n \n )}\n
\n \n );\n}\n", "type": "registry:component", "target": "components/uitripled/fluid-modal-transition-shadcnui.tsx" } ] }