Better Dialog
It’s a better way to build modal UIs — with the native <dialog>
element.
Better Dialog is a lightweight JavaScript library that enhances the native <dialog>
element, offering a clean and flexible API for building accessible, animated modal UIs.
Rather than reinventing the wheel, Better Dialog embraces what browsers already provide natively — and makes it better. You get the benefits of real HTML semantics, accessibility, keyboard support, and optional animations or plugins that stay out of your way unless you want them.
Whether you’re building a design system, a product UI, or just a simple modal, Better Dialog gives you a solid foundation without bloated dependencies.
Try It!
Here’s a live example you can interact with right now:
Key Features
- ⚡ Lightweight & dependency-free
- 🎬 Plugin-based animation & behavior
- 🧩 Extendable with custom logic
- 🌐 Native-first, modern browser support
- 🎨 No styles included — bring your own design
What Better Dialog Adds
Better Dialog builds on top of the native <dialog>
element to provide:
- Easy closing by clicking outside the dialog (backdrop)
- Optional animation hooks with lifecycle awareness
- A plugin system for reusable logic (e.g. scroll lock)
- Built-in trigger binding via
data-better-dialog-show