Skip to content

Glass Modal Dialog

A frosted glass modal dialog with a layered backdrop blur, close button, and floating action buttons.

Glass Modal Dialog

by FreeCsStyles Dev's

GlassmorphismGlassmorphism
🌐
#glass#modal#dialog#overlay

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/glass-modal-dialog.

<iframe src="/embed/glass-modal-dialog" sandbox="allow-scripts" loading="lazy" title="Glass Modal Dialog" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Glass Modal Dialog. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.

HTML
<div class="glass-modal-backdrop">
  <div class="glass-modal">
    <div class="modal-header">
      <div class="modal-icon">🔔</div>
      <button class="modal-close">✕</button>
    </div>
    <h2>Enable Notifications?</h2>
    <p>Get real-time updates about new components, replies, and activity.</p>
    <div class="modal-actions">
      <button class="btn-secondary">Not Now</button>
      <button class="btn-primary">Enable</button>
    </div>
  </div>
</div>
CSS
.glass-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.glass-modal {
  max-width: 340px;
  border-radius: 20px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
}

.glass-modal h2 { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.glass-modal p { font-size: 13px; color: rgba(255, 255, 255, 0.7); line-height: 1.6; margin-bottom: 20px; }

.modal-actions { display: flex; gap: 10px; }

.btn-secondary {
  flex: 1;
  padding: 11px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-primary {
  flex: 1;
  padding: 11px 0;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

Where Glass Modal Dialog fits

  • Confirmations
  • Settings Panels
  • Quick Actions

Topics

  • #glass
  • #modal
  • #dialog
  • #overlay