Getting Started
Installation
npm install @haebaragi/better-dialog
yarn add @haebaragi/better-dialog
Basic Usage
1. Write the HTML
<button data-better-dialog-show="my-dialog">Open Dialog</button>
<dialog id="my-dialog"> <p>Hello, world!</p> <button data-better-dialog-close>Close</button></dialog>
2. Initialize with JavaScript
import { BetterDialog } from '@haebaragi/better-dialog';
new BetterDialog('#my-dialog');
That’s it — you now have a working modal, powered by the native <dialog>
element.