Modal

Neumorphic dialogs with backdrop blur, animations, and focus trap.

This component requires softui.js for interactive behavior.

Default Modal

<div class="sui-modal-backdrop" id="myModal" role="dialog" aria-modal="true" aria-labelledby="myModalTitle">
  <div class="sui-modal">
    <div class="sui-modal-header">
      <h3 id="myModalTitle">Modal Title</h3>
      <button class="sui-modal-close" aria-label="Close"></button>
    </div>
    <div class="sui-modal-body">
      <p>This is a neumorphic modal dialog. It features backdrop blur, smooth animations, and focus trap. Press Escape or click outside to close.</p>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#myModal').close()">Cancel</button>
      <button class="sui-btn sui-btn-primary sui-btn-sm">Confirm</button>
    </div>
  </div>
</div>

<script>
  // Open and close by selector or element
  SoftUI.modal('#myModal').open();
  SoftUI.modal('#myModal').close();
  // Escape, the backdrop, the X and close() all return focus to the
  // element that opened the modal. Escape closes the topmost modal/sheet.
</script>

Small Modal

<div class="sui-modal-backdrop" id="mySmallModal" role="dialog" aria-modal="true" aria-labelledby="mySmallModalTitle">
  <div class="sui-modal sui-modal-sm">
    <div class="sui-modal-header">
      <h3 id="mySmallModalTitle">Session Timeout</h3>
      <button class="sui-modal-close" aria-label="Close"></button>
    </div>
    <div class="sui-modal-body">
      <p>Your session will expire in 5 minutes. Would you like to stay signed in?</p>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#mySmallModal').close()">Sign Out</button>
      <button class="sui-btn sui-btn-primary sui-btn-sm" onclick="SoftUI.modal('#mySmallModal').close()">Stay Signed In</button>
    </div>
  </div>
</div>

Large Modal with Form

<div class="sui-modal-backdrop" id="myLargeModal" role="dialog" aria-modal="true" aria-labelledby="myLargeModalTitle">
  <div class="sui-modal sui-modal-lg">
    <div class="sui-modal-header">
      <h3 id="myLargeModalTitle">Create Account</h3>
      <button class="sui-modal-close" aria-label="Close"></button>
    </div>
    <div class="sui-modal-body">
      <div class="sui-form-group"><label class="sui-label">Full Name</label><input type="text" class="sui-input" placeholder="John Doe"></div>
      <div class="sui-form-group"><label class="sui-label">Email Address</label><input type="email" class="sui-input" placeholder="john@example.com"></div>
      <div class="sui-form-group"><label class="sui-label">Message</label><textarea class="sui-input sui-textarea" placeholder="Tell us about yourself..."></textarea></div>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#myLargeModal').close()">Cancel</button>
      <button class="sui-btn sui-btn-primary sui-btn-sm">Create Account</button>
    </div>
  </div>
</div>

Fullscreen Modal

<div class="sui-modal-backdrop" id="myFullscreenModal" role="dialog" aria-modal="true" aria-labelledby="myFullscreenModalTitle">
  <div class="sui-modal sui-modal-fullscreen">
    <div class="sui-modal-header">
      <h3 id="myFullscreenModalTitle">Fullscreen Modal</h3>
      <button class="sui-modal-close" aria-label="Close"></button>
    </div>
    <div class="sui-modal-body">
      <p>This modal takes up the entire viewport. Useful for immersive content, editors, or media viewers.</p>
      <p>Press Escape or click the close button to dismiss.</p>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#myFullscreenModal').close()">Close</button>
    </div>
  </div>
</div>

Scrollable Modal

<div class="sui-modal-backdrop" id="myScrollableModal" role="dialog" aria-modal="true" aria-labelledby="myScrollableModalTitle">
  <div class="sui-modal sui-modal-scrollable">
    <div class="sui-modal-header">
      <h3 id="myScrollableModalTitle">Terms of Service</h3>
      <button class="sui-modal-close" aria-label="Close"></button>
    </div>
    <div class="sui-modal-body">
      <h4 style="margin-bottom:12px;">1. Acceptance of Terms</h4>
      <p>By accessing and using this service, you accept and agree to be bound by the terms and provision of this agreement. In addition, when using these particular services, you shall be subject to any posted guidelines or rules applicable to such services. Any participation in this service will constitute acceptance of this agreement.</p>
      <h4 style="margin-bottom:12px;">2. Use License</h4>
      <p>Permission is granted to temporarily download one copy of the materials on this website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not modify or copy the materials, use the materials for any commercial purpose, attempt to reverse engineer any software, or remove any copyright notations.</p>
      <h4 style="margin-bottom:12px;">3. Disclaimer</h4>
      <p>The materials on this website are provided on an 'as is' basis. We make no warranties, expressed or implied, and hereby disclaim and negate all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property.</p>
      <h4 style="margin-bottom:12px;">4. Limitations</h4>
      <p>In no event shall this company or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials, even if we have been notified orally or in writing of the possibility of such damage.</p>
      <h4 style="margin-bottom:12px;">5. Accuracy of Materials</h4>
      <p>The materials appearing on this website could include technical, typographical, or photographic errors. We do not warrant that any of the materials on its website are accurate, complete or current. We may make changes to the materials contained on its website at any time without notice.</p>
      <h4 style="margin-bottom:12px;">6. Links</h4>
      <p>We have not reviewed all of the sites linked to this website and are not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement. Use of any such linked web site is at the user's own risk.</p>
      <h4 style="margin-bottom:12px;">7. Modifications</h4>
      <p>We may revise these terms of service for this website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service. Any changes will be posted on this page with an updated revision date.</p>
      <h4 style="margin-bottom:12px;">8. Governing Law</h4>
      <p>These terms and conditions are governed by and construed in accordance with applicable laws and you irrevocably submit to the exclusive jurisdiction of the courts in that location. If any provision of these terms shall be unlawful, void, or unenforceable, then that provision shall be deemed severable and shall not affect the validity of the remaining provisions.</p>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#myScrollableModal').close()">Decline</button>
      <button class="sui-btn sui-btn-primary sui-btn-sm">Accept</button>
    </div>
  </div>
</div>

Static Backdrop

<div class="sui-modal-backdrop sui-modal-static" id="myStaticModal" role="dialog" aria-modal="true" aria-labelledby="myStaticModalTitle">
  <div class="sui-modal">
    <div class="sui-modal-header">
      <h3 id="myStaticModalTitle">Static Backdrop</h3>
      <button class="sui-modal-close" aria-label="Close"></button>
    </div>
    <div class="sui-modal-body">
      <p>Clicking outside this modal won't close it. Instead, the modal will shake to indicate it requires explicit action. Pressing Escape shakes it too — use the close button or an action to dismiss.</p>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#myStaticModal').close()">Cancel</button>
      <button class="sui-btn sui-btn-primary sui-btn-sm">Understood</button>
    </div>
  </div>
</div>

Alert Dialog

sui-modal-static + role="alertdialog" with no close button: the user must pick an action.

<!-- Alert Dialog = sui-modal-sm + sui-modal-static + no close button -->
<div class="sui-modal-backdrop sui-modal-static" id="alertDialog" role="alertdialog" aria-modal="true" aria-labelledby="alertTitle" aria-describedby="alertDesc">
  <div class="sui-modal sui-modal-sm">
    <div class="sui-modal-header">
      <h3 id="alertTitle">Delete this item?</h3>
    </div>
    <div class="sui-modal-body">
      <p id="alertDesc">This action cannot be undone. This will permanently delete the item and remove all associated data.</p>
    </div>
    <div class="sui-modal-footer">
      <button class="sui-btn sui-btn-sm" onclick="SoftUI.modal('#alertDialog').close()">Cancel</button>
      <button class="sui-btn sui-btn-danger sui-btn-sm" onclick="SoftUI.modal('#alertDialog').close()">Delete</button>
    </div>
  </div>
</div>

Backdrop Blur

<!-- No blur -->
<div class="sui-modal-backdrop sui-modal-blur-none" id="blurNone" role="dialog" aria-modal="true">
  <div class="sui-modal">...</div>
</div>

<!-- Small blur (3px) -->
<div class="sui-modal-backdrop sui-modal-blur-sm" id="blurSm" role="dialog" aria-modal="true">
  <div class="sui-modal">...</div>
</div>

<!-- Default blur (6px), no class needed -->
<div class="sui-modal-backdrop" id="blurDefault" role="dialog" aria-modal="true">
  <div class="sui-modal">...</div>
</div>

<!-- Large blur (12px) -->
<div class="sui-modal-backdrop sui-modal-blur-lg" id="blurLg" role="dialog" aria-modal="true">
  <div class="sui-modal">...</div>
</div>

<!-- Extra large blur (20px) -->
<div class="sui-modal-backdrop sui-modal-blur-xl" id="blurXl" role="dialog" aria-modal="true">
  <div class="sui-modal">...</div>
</div>

<!-- Available classes: sui-modal-blur-none, sui-modal-blur-sm, sui-modal-blur-md, sui-modal-blur-lg, sui-modal-blur-xl -->

<!-- Modals use overflow:visible by default — datepickers and dropdowns inside will not be clipped.
     Use sui-modal-scrollable when content needs scrolling. -->

Delete this item?

This action cannot be undone. This will permanently delete the item and remove all associated data.