Component
Warning Modal
Warning notification modal with gradient icon, progress bar, and action options for user attention and resolution.
- Component
- Tailwind
- HTML
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/modals/warning-modal/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Modals/warning-modal Tailwind/Components/Modals/warning-modal <!-- Warning Modal -->
<div id="warning-modal" class="fixed inset-0 z-50 hidden">
<!-- Backdrop -->
<div class="fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity" onclick="closeModal('warning-modal')"></div>
<!-- Modal Container -->
<div class="fixed inset-0 flex items-center justify-center p-4">
<div class="relative bg-white dark:bg-gray-900 rounded-2xl shadow-2xl w-full max-w-md transform transition-all" role="alertdialog" aria-modal="true" aria-labelledby="warning-modal-title">
<!-- Close Button -->
<button onclick="closeModal('warning-modal')" class="absolute top-4 right-4 p-2 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors focus:outline-none focus:ring-2 focus:ring-amber-500">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
<!-- Warning Icon -->
<div class="flex justify-center pt-8">
<div class="w-20 h-20 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center shadow-lg shadow-amber-500/30">
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
</div>
</div>
<!-- Content -->
<div class="p-6 text-center">
<h3 id="warning-modal-title" class="text-xl font-bold text-gray-900 dark:text-white mb-3">Low Storage Warning</h3>
<p class="text-gray-600 dark:text-gray-400 leading-relaxed mb-4">Your cloud storage is running low. You have used 85% of your 50GB storage quota.</p>
<!-- Storage Bar -->
<div class="bg-gray-100 dark:bg-gray-800 rounded-full h-3 overflow-hidden mb-2">
<div class="bg-gradient-to-r from-amber-400 to-orange-500 h-full rounded-full" style="width: 85%;"></div>
</div>
<p class="text-sm text-gray-500 dark:text-gray-400">42.5 GB of 50 GB used</p>
</div>
<!-- Options -->
<div class="mx-6 mb-6 space-y-3">
<button onclick="closeModal('warning-modal')" class="w-full flex items-center gap-3 p-4 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-xl hover:bg-amber-100 dark:hover:bg-amber-900/30 transition-colors">
<div class="w-10 h-10 bg-amber-100 dark:bg-amber-900/50 rounded-lg flex items-center justify-center">
<svg class="w-5 h-5 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/>
</svg>
</div>
<div class="text-left flex-1">
<p class="text-sm font-medium text-gray-900 dark:text-white">Upgrade Storage</p>
<p class="text-xs text-gray-500 dark:text-gray-400">Get 100GB for $4.99/month</p>
</div>
<svg class="w-5 h-5 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</button>
<button onclick="closeModal('warning-modal')" class="w-full flex items-center gap-3 p-4 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors">
<div class="w-10 h-10 bg-gray-100 dark:bg-gray-700 rounded-lg flex items-center justify-center">
<svg class="w-5 h-5 text-gray-600 dark:text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"/>
</svg>
</div>
<div class="text-left flex-1">
<p class="text-sm font-medium text-gray-900 dark:text-white">Clear Cache</p>
<p class="text-xs text-gray-500 dark:text-gray-400">Free up 2.3GB immediately</p>
</div>
</button>
</div>
<!-- Dismiss -->
<div class="p-6 pt-0 text-center">
<button onclick="closeModal('warning-modal')" class="text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 underline transition-colors">Remind me later</button>
</div>
</div>
</div>
</div>
<!-- Demo Trigger Button -->
<button onclick="openModal('warning-modal')" class="px-6 py-3 bg-amber-500 text-white font-medium rounded-xl hover:bg-amber-600 transition-colors focus:outline-none focus:ring-2 focus:ring-amber-500 focus:ring-offset-2">Open Warning Modal</button> # Warning Modal
Warning dialog modal.
## Usage
```bash
npx devsnips add Tailwind/Components/Modals/warning-modal
```
Copy from `code.html`.
## File Structure
`code.html` · `preview.html` · `metadata.json` · `README.md` 77 lines UTF-8 · LF · Spaces: 2
Continue browsing