Modals and drawers

Dialogs, side panels, bottom sheets and confirmations.

The choice between a modal and a drawer is about context: a modal takes the screen and demands an answer, a drawer keeps the page visible so you can compare against it. Detail views want drawers; destructive confirmations want modals. These cover both, plus the phone case, where a bottom sheet is what the platform has trained people to expect.

8 matching8 blocksFree to copy
Open the full page for this block

Destructive Confirm Dialog

A type-to-confirm dialog built on native <dialog>, so the focus trap, top layer and escape handling come from the browser. Focus lands on Cancel, and the button says the verb.

Modals & Drawers184 lines1 dep
Open the full page for this block

Faceted Filter Drawer

Facets with per-option counts, zero-result options disabled rather than hidden so the list never jumps, and a pending selection applied on a button that says how many choices changed.

Modals & Drawers241 lines1 dep
Open the full page for this block

Share & Access Dialog

The share modal where a design mistake is a data leak: general access stated as its consequence rather than its setting, and a copy button that never silently widens access.

Modals & Drawers312 lines1 dep
Open the full page for this block

Mobile Bottom Sheet

Half and full snap points where the content owns the scroll and overscroll-contain keeps the page behind still. The drag handle is a real button, Escape and the backdrop close it, and safe-area padding keeps the last row pressable.

Modals & Drawers266 lines1 dep
Open the full page for this block

Cookie Consent Banner

Per-category consent where refusing is exactly as easy as accepting, nothing non-essential is pre-ticked, and the page behind it stays readable — the shape the law expects, wired to your own script gating.

Modals & Drawers232 lines1 dep
Open the full page for this block

Slide-Over Edit Panel

A side sheet for editing a record without losing the list behind it — native <dialog> for the trapping, a data attribute for the slide, and a sticky footer so Save never scrolls away.

Modals & Drawers208 lines1 dep
Open the full page for this block

Unsaved Changes Prompt

The interception that keeps work: three answers rather than two, the changed fields listed by name, a destructive-styled discard, and Escape resolving to cancel.

Modals & Drawers237 lines1 dep
Open the full page for this block

Record Inspector Drawer

A non-modal drawer that keeps the list on screen, with previous and next controls for moving between records and an activity tab beside the fields.

Modals & Drawers336 lines1 dep

Questions about modals and drawers

Should a drawer be dismissible by clicking outside?
Yes for a read-only panel, no when it contains an unsaved form — or prompt on dismiss. Losing a half-written form to a stray click is the complaint that follows every "just close it" implementation.
Can I nest a modal inside a modal?
You can, and it is nearly always a sign the first one is doing too much. If you must, the second has to stack above the first and return focus to it on close rather than to the page.
Are these modals and drawers free to use?
All 8 are free to copy and use in your own projects, including commercial ones. A Pro licence exists for redistribution — shipping them inside a product other people buy — and the full terms are on the licence page.
How do I add one to my project?
Install it with the CLI: `npx hoverlab add confirm-dialog` writes the component and its dependencies into your project. Every artifact here also has a copy button for the raw source, and an "Open in sandbox" link if you would rather try it first.