Skip to content

Mobile Modal Sheet

A copy-paste mobile patterns component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Mobile PatternsHTMLCSSany framework

Copy into your project

HTML
<div class="nuda-mmodal">
  <div class="nuda-mmodal__scrim"></div>
  <div class="nuda-mmodal__panel" role="dialog" aria-labelledby="mm-title">
    <div class="nuda-mmodal__icon" aria-hidden="true">⚠</div>
    <div id="mm-title" class="nuda-mmodal__title">Delete file?</div>
    <div class="nuda-mmodal__desc">This action cannot be undone.</div>
    <div class="nuda-mmodal__actions">
      <button type="button" class="nuda-mmodal__btn">Cancel</button>
      <button type="button" class="nuda-mmodal__btn nuda-mmodal__btn--primary">Delete</button>
    </div>
  </div>
</div>
CSS
/* Mobile Modal Sheet
   Centered alert with dim backdrop and pop-in panel.
   Customize: --mm-bg, --mm-danger */

.nuda-mmodal {
  --mm-bg: #111114;
  --mm-danger: #ef4444;
  position: relative;
  width: 280px;
  height: 280px;
  background: #09090b;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui;
}

.nuda-mmodal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: nuda-mm-fade 0.35s ease both;
}

.nuda-mmodal__panel {
  position: relative;
  width: 240px;
  padding: 20px 18px 14px;
  background: var(--mm-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: nuda-mm-zoom 0.4s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.nuda-mmodal__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--mm-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.nuda-mmodal__title { color: #fafafa; font: 700 15px/1.2 system-ui; }
.nuda-mmodal__desc { color: #a0a0a8; font: 500 12px/1.4 system-ui; margin-bottom: 8px; }

.nuda-mmodal__actions { display: flex; gap: 8px; width: 100%; margin-top: 4px; }

.nuda-mmodal__btn {
  flex: 1;
  appearance: none;
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #fafafa;
  font: 600 12px/1 system-ui;
  cursor: pointer;
  transition: background 0.15s;
}

.nuda-mmodal__btn:hover { background: rgba(255, 255, 255, 0.04); }

.nuda-mmodal__btn--primary {
  background: var(--mm-danger);
  border-color: var(--mm-danger);
  color: #fff;
}

.nuda-mmodal__btn--primary:hover { background: #dc2626; }

@keyframes nuda-mm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes nuda-mm-zoom {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-mmodal__scrim,
  .nuda-mmodal__panel { animation: none; }
}

How to use Mobile Modal Sheet

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More mobile patterns components

← Browse all NudaUI components