DocumentationDialog Form

Dialog Form

An animated dialog form component that expands from a button with smooth layout transitions. Includes success state with shine animation.

Install using CLI

npx shadcn@latest add "https://obsidianui.dev/r/dialog-form.json"

Install Manually

1

Install dependencies

npm install framer-motion lucide-react usehooks-ts clsx tailwind-merge
2

Copy the source code

Copy into components/ui/dialog-form.tsx

Note: This is a large component (370+ lines). Install via CLI for the full source code with animations.

Props

Prop NameTypeDefaultDescription
labelstring-Button/dialog title
successTextstring-Text shown on success
successIconReact.ReactNode-Icon shown on success
iconReact.ReactNode-Icon for the button
childComponentReact.ReactNode-Form content inside dialog
onSubmit() => Promise<{success, message}>-Submit handler
onClose() => void-Close callback