Home Components Dialog
React Dialog Components
23 free React dialogs and modals built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for confirmations, forms, and alert dialogs.
Dialog 1 : Confirmation alert dialog on a frosted blurred panel with a grey Cancel and a pill-shaped Continue button.Dialog 2 : Informational alert dialog with a blue info icon, a support email link and a blue OK button.Dialog 3 : Destructive alert dialog with a red warning icon, an acknowledgement checkbox and a red Delete button.Dialog 4 : Scrollable dialog for long release notes, with a fixed title and Back and Read More footer buttons.Dialog 5 : Dialog with a bordered sticky header above scrolling terms text, ending in Decline and I Agree buttons.Dialog 6 : Dialog whose footer stays pinned while the header and a long audit report scroll above it.Dialog 7 : Fullscreen dialog filling the viewport with scrollable product details, testimonials and a footer action bar.Dialog 8 : Terms and conditions dialog with numbered legal sections, a tinted header and Cancel and I Agree buttons.Dialog 9 : Newsletter subscribe dialog with an email field and a Join Now button placed inline beside it.Dialog 10 : Refer-a-friend dialog with an email input, consent checkbox and an overlapping avatar stack with a +10 count.Dialog 11 : Feedback dialog with a five-face emoji rating scale, a comments textarea and a consent checkbox.Dialog 12 : OTP verification dialog with a five-digit code input that checks on completion and shows a success state.Dialog 13 : Sign-up dialog with first and last name fields, password, a terms checkbox and a Continue with Google button.Dialog 14 : Sign-in dialog with a centred login icon, email and password fields and four social login buttons.Dialog 15 : Team invite dialog with a name and email form plus a list of contacts, each with an Invite button.Dialog 16 : Profile settings dialog anchored to the top-left corner of the screen on larger viewports.Dialog 17 : Profile settings dialog pinned to the top centre of the screen instead of the middle.Dialog 18 : Profile settings dialog anchored to the top-right corner of the screen on larger viewports.Dialog 19 : Profile settings dialog docked to the left edge and vertically centred on larger viewports.Dialog 20 : Profile settings dialog docked to the right edge and vertically centred on larger viewports.Dialog 21 : Profile settings dialog anchored to the bottom-left corner of the screen on larger viewports.Dialog 22 : Profile settings dialog pinned to the bottom centre of the screen instead of the middle.Dialog 23 : Profile settings dialog anchored to the bottom-right corner of the screen on larger viewports.
About React Dialog Components A React dialog, often called a modal, is a window that opens over the page and holds focus until it is closed. Watermelon UI dialogs are built on the Radix UI Dialog primitive with Tailwind CSS, so focus trapping, Escape to close, and screen reader labels work out of the box. Add one with the shadcn CLI, then put your form or message inside DialogContent.
When to use it Short forms like inviting a teammate or renaming a file. Confirming a destructive action such as deleting a project. Previews or details that need the user’s full attention. When to use something else Use Sheet when the content is long or works best as a side panel. Use Popover when the content is small and should stay next to its trigger without blocking the page. Use Alerts when the message is informational and does not need a response. Frequently asked questions How do I stop a shadcn dialog from closing on outside click? Call event.preventDefault() in onInteractOutside on DialogContent. Use onEscapeKeyDown the same way if Escape should not close it either.
How do I change the width of a shadcn dialog? Pass a max width at the sm breakpoint to DialogContent, for example className="sm:max-w-2xl". The content ships with sm:max-w-sm, so a plain max-w-2xl class still loses to it on larger screens.
How do I close the dialog after a form submits? Control the dialog and set open to false when the submit succeeds. Wrapping the submit button in DialogClose closes it before your request finishes, so avoid that for async forms.
How do I hide the close button in the corner? Pass showCloseButton={false} to DialogContent. Make sure the dialog still has another way to close, like a Cancel button.
How to use React Dialog Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/dialog-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: lucide-react, input-otp.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .