Novus Technologies Novus Technologies design kit v0.9.0
Menu

Feedback

Modal

In-page detail dialog, native dialog gives focus trap, Esc, and inert background.

.modal · .modal__backdrop · .modal__actions · .modal-close · .vdialog

novatrust

What it covers

  • HSM as a Service, key management, encryption and tokenisation.
  • 24/7 SOC, fraud prevention, post-quantum resilience.
Detail dialog (native, shown open)
<dialog class="vdialog" open style="position:static;margin:0">
  <div class="vdialog__head">
    <h3 style="margin:0">novatrust</h3>
    <button class="modal-close" aria-label="Close">×</button>
  </div>
  <div class="vdialog__body">
    <h4>What it covers</h4>
    <ul class="bullets">
      <li>HSM as a Service, key management, encryption and tokenisation.</li>
      <li>24/7 SOC, fraud prevention, post-quantum resilience.</li>
    </ul>
  </div>
</dialog>

Dialog title

Native dialog.showModal() gives focus trap, Esc to close, and an inert background.

Trigger + modal open
<button class="btn btn--primary" onclick="this.nextElementSibling.showModal()">Open dialog</button>
<dialog class="vdialog">
  <div class="vdialog__head">
    <h3 style="margin:0">Dialog title</h3>
    <button class="modal-close" aria-label="Close" onclick="this.closest('dialog').close()">×</button>
  </div>
  <p class="muted">Native <code>dialog.showModal()</code> gives focus trap, Esc to close, and an inert background.</p>
  <div class="modal__actions">
    <button class="btn btn--secondary" onclick="this.closest('dialog').close()">Cancel</button>
    <button class="btn btn--primary" onclick="this.closest('dialog').close()">Confirm</button>
  </div>
</dialog>

Usage

  • Prefer native <dialog class="vdialog">, the browser provides focus management and Esc for free.
  • A click anywhere outside the dialog, on the backdrop, closes it, the same as Cancel. The console script does this for every dialog opened with showModal(). A framework that renders the dialog from its own state still opens it that way, by calling novusAdmin.showModal(dialog) after render, never by drawing it with the open attribute, which leaves it in the page flow with no backdrop; it clears that state on the dialog's close event.
  • Content that must stay reachable with JS off belongs in a <details> disclosure, not a modal.
  • Actions sit right-aligned in .modal__actions; the primary action is last.