1. tailwind components
  2. dialogs

Dialogs

Display modal popups using the native HTML dialog element.

Warning

This feature is currently marked as beta and not intended for production use. It may receive breaking changes before its stable release.

Hello world!

This is an example modal created using the native Dialog element.

Alert Dialog

Set role="alertdialog" for dialogs that interrupt the user with a message requiring a response.

Discard changes?

You have unsaved changes that will be lost. This action cannot be undone.

Non-Modal

Call show() instead of showModal() to open a dialog without a backdrop or top-layer placement. Similar to a tooltip.

This acts as a tooltip.

Fullscreen

Add dialog-fullscreen to expand the dialog to the full viewport.

Hello world!

This dialog expands to fill the entire viewport and locks page scrolling while open.

Animation

Add animate-dialog to opt into a fade transition for the dialog and its backdrop.

Hello world!

Opening and closing this dialog fades the surface and backdrop.

Interaction

Light Dismiss

Set closedby="any" to allow the user to close the dialog by clicking the backdrop or pressing Esc.

Click outside to close

This dialog supports light dismiss. Click the backdrop or press Esc to close.

⚠️ View Browser Support
BrowserMinimum VersionReleased
Safari18.2December 2024
Safari on iOS18.2December 2024
Chrome134March 2025
Edge134March 2025
Chrome for Android134March 2025
Firefox136March 2025
Firefox for Android136March 2025

Result Handling

Wrap controls in a <form method="dialog"> , then read each submit button’s value from dialog.returnValue on close .

Confirm action

Submitting either button closes the dialog and exposes its value via the dialog's returnValue.

Last result:

Invoker Commands

Use the Invoker Commands API to control state with pure HTML.

Hello world!

This modal is controlled using HTML invoker commands — no JavaScript required.

⚠️ View Browser Support
BrowserMinimum VersionReleased
Chrome135April 2025
Edge135April 2025
Chrome for Android135April 2025
Firefox144October 2025
Firefox for Android144October 2025
Safari26.2December 2025
Safari on iOS26.2December 2025

Alternatives

Explore Skeleton’s framework components for more advanced features and control:

View page on GitHub