Modals and Dialogs for React and Tailwind
A dialog interrupts people, so it has to be worth it. Good ones trap focus properly, close with the escape key and return you to where you were. Long content and small screens are the real tests. Try each one from the keyboard before you decide, then install it as code you own and use it sparingly. Ask whether the page itself could answer first.
About modals and dialogs
Modals and dialogs pause the page to ask for something: a confirmation before deleting, a short form, a detail view or a message that can't be missed. They come as centred windows, alert dialogs with two clear choices, full screen sheets on phones and nested steps inside one frame.
Use a modal only when the task really blocks everything else, and keep it short. Focus must move into it on open and return to the trigger on close, Escape and a visible close button should both work, and the page behind must not scroll while it's open.
