Conversation

You

How do I add a dialog to my PHP page?

Assistant

Thought for 3 seconds

The user wants a modal dialog. Bootcn ships it as a component built on Bootstrap's modal, so the CLI command and the markup are enough.

Install the component with the CLI:

Terminal
npx bootcn add dialog

Then include components/ui/dialog.html where you need it, and load dialog.css and the Bootstrap bundle on the page.

You

Can it close when I press Escape?

Assistant

Yes. Bootstrap's modal closes on Esc and returns focus to the button that opened it. Add data-bs-backdrop="static" if clicks outside should not close it.