Notification/Toast Generator
Create beautiful toast notifications with multiple types (info, success, warning, error), customizable positions, auto-dismiss, and progress bars.
Live Preview
✓×
Success!
Your changes have been saved successfully.
Generated Code
<style>
.toast-notification {
position: fixed;
top: 20px; right: 20px;
width: 360px;
max-width: 90vw;
background: #f0fdf4;
border-left: 4px solid #22c55e;
border-radius: 8px;
padding: 14px 16px;
font-family: system-ui, sans-serif;
box-shadow: 0 4px 20px rgba(0,0,0,0.12);
z-index: 9999;
animation: toast-slide 0.3s ease;
display: flex;
align-items: flex-start;
gap: 10px;
}
@keyframes toast-slide {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
.toast-icon {
font-size: 18px;
color: #22c55e;
line-height: 1;
flex-shrink: 0;
}
.toast-content { flex: 1; }
.toast-title {
font-size: 14px;
font-weight: 600;
color: #1a1a2e;
margin: 0 0 2px;
}
.toast-message {
font-size: 12px;
color: #1a1a2e;
opacity: 0.75;
margin: 0;
line-height: 1.4;
}
.toast-close {
background: none;
border: none;
font-size: 16px;
color: #1a1a2e;
opacity: 0.4;
cursor: pointer;
padding: 0;
line-height: 1;
flex-shrink: 0;
}
.toast-close:hover { opacity: 0.8; }
.toast-progress {
position: absolute;
bottom: 0;
left: 0;
height: 3px;
background: #22c55e;
border-radius: 0 0 0 8px;
animation: toast-progress 5000ms linear forwards;
}
@keyframes toast-progress {
from { width: 100%; }
to { width: 0%; }
}
</style>
<div class="toast-notification" id="toastNotification">
<span class="toast-icon">✓</span>
<div class="toast-content">
<p class="toast-title">Success!</p>
<p class="toast-message">Your changes have been saved successfully.</p>
</div>
<button class="toast-close" onclick="this.parentElement.remove()">×</button>
<div class="toast-progress"></div>
</div>
<script>
setTimeout(function() {
var el = document.getElementById("toastNotification");
if (el) el.remove();
}, 5000);
</script>