Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

Modal Dialog

Native dialog patterns with forms, confirmation, and scrolling. Accessible by default with focus management.

Overview

Modal dialogs use the native HTML <dialog> element which provides built-in accessibility features: focus trapping, escape key handling, and proper ARIA semantics. No JavaScript library required.

Key features:

  • Native focus management and trapping
  • Escape key closes dialog
  • Built-in backdrop with ::backdrop
  • Form integration with method="dialog"
  • Return value for form submissions

Basic Modal

A simple modal with header, body content, and action buttons.

Confirmation Dialog

A centered confirmation dialog for destructive actions. Uses method="dialog" for form submission.

Form Modal

A modal containing a form with inputs. Includes a close button in the header.

Dialog Styles

Base styles for the dialog element. Add to your project CSS.

Usage Notes

  • Opening: Use dialog.showModal() for modal behavior with backdrop
  • Closing: Use dialog.close() or let users press Escape
  • Return value: Use method="dialog" on forms to get the submit button's value
  • Focus: First focusable element receives focus when opened
  • Click outside: Add click listener on dialog to close when clicking backdrop
  • Scrolling: For long content, give the body section a max-block-size and overflow-y: auto

Click Outside to Close

Related

Dialog Element

Native dialog documentation

Toast Notifications

Non-blocking notifications

↑