Alert
Displays a callout for important information, feedback, or actions.
Default
Heads up!
You can add components to your app using the CLI.
<div class="vt-alert">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="11.9999" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 15.9999L12 11.9999" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M11.875 8.24994L12 8.24994M11.75 8.24994C11.75 8.11187 11.8619 7.99994 12 7.99994C12.1381 7.99994 12.25 8.11187 12.25 8.24994C12.25 8.38801 12.1381 8.49994 12 8.49994C11.8619 8.49994 11.75 8.38801 11.75 8.24994Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Heads up!</h3>
<p class="vt-alert-description">You can add components to your app using the CLI.</p>
</div>
</div>
Variants
Alerts using semantic colors for different contexts.
Information
A new software update is available. See what's new in version 3.0.
Success
Your payment has been processed successfully.
Warning
Your free trial expires in 3 days. Upgrade your plan to continue.
Error
There was a problem with your request. Please try again.
<div class="vt-alert vt-alert-info">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="11.9999" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 15.9999L12 11.9999" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M11.875 8.24994L12 8.24994M11.75 8.24994C11.75 8.11187 11.8619 7.99994 12 7.99994C12.1381 7.99994 12.25 8.11187 12.25 8.24994C12.25 8.38801 12.1381 8.49994 12 8.49994C11.8619 8.49994 11.75 8.38801 11.75 8.24994Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Information</h3>
<p class="vt-alert-description">A new software update is available. See what's new in version 3.0.</p>
</div>
</div>
<div class="vt-alert vt-alert-success">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8 12.5L10 14.5L15.5 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Success</h3>
<p class="vt-alert-description">Your payment has been processed successfully.</p>
</div>
</div>
<div class="vt-alert vt-alert-warning">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 9V13" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Warning</h3>
<p class="vt-alert-description">Your free trial expires in 3 days. Upgrade your plan to continue.</p>
</div>
</div>
<div class="vt-alert vt-alert-danger">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 8V12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Error</h3>
<p class="vt-alert-description">There was a problem with your request. Please try again.</p>
</div>
</div>
With Description
Alerts with extended descriptions providing more context.
Security Update Required
A critical security update is available for your account. Two-factor authentication has been reset due to a recent security incident. Please re-enable it to secure your account.
Sync in Progress
Your data is being synchronized across all devices. This may take a few minutes depending on the amount of data. You can continue working while the sync completes in the background.
<div class="vt-alert">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M20.9922 11.1833V8.28029C20.9922 6.64029 20.9922 5.82028 20.5881 5.28529C20.184 4.75029 19.2703 4.49056 17.4429 3.9711C16.1944 3.6162 15.0938 3.18863 14.2145 2.79829C13.0156 2.2661 12.4161 2 11.9922 2C11.5682 2 10.9688 2.2661 9.7699 2.79829C8.89057 3.18863 7.79002 3.61619 6.54152 3.9711C4.71411 4.49056 3.80041 4.75029 3.3963 5.28529C2.99219 5.82028 2.99219 6.64029 2.99219 8.28029V11.1833C2.99219 16.8085 8.05496 20.1835 10.5861 21.5194C11.1932 21.8398 11.4968 22 11.9922 22C12.4876 22 12.7911 21.8398 13.3982 21.5194C15.9294 20.1835 20.9922 16.8085 20.9922 11.1833Z" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path><path d="M8.49219 11.8333C8.49219 11.8333 9.36719 11.8333 10.2422 13.5C10.2422 13.5 13.0216 9.33333 15.4922 8.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Security Update Required</h3>
<p class="vt-alert-description">A critical security update is available for your account. Two-factor authentication has been reset due to a recent security incident. Please re-enable it to secure your account.</p>
</div>
</div>
<div class="vt-alert vt-alert-info">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M3.04712 13C3.01082 12.6717 2.99219 12.338 2.99219 12C2.99219 7.02944 7.02162 3 11.9922 3C14.8195 3 17.3422 4.30367 18.9922 6.34267M20.9373 11C20.9736 11.3283 20.9922 11.662 20.9922 12C20.9922 16.9706 16.9628 21 11.9922 21C9.16492 21 6.64214 19.6963 4.99219 17.6573" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M15.9922 7H16.9922C18.4064 7 19.1135 7 19.5528 6.56066C19.9922 6.12132 19.9922 5.41421 19.9922 4V3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7.99219 17H6.99219C5.57797 17 4.87087 17 4.43153 17.4393C3.99219 17.8787 3.99219 18.5858 3.99219 20V21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Sync in Progress</h3>
<p class="vt-alert-description">Your data is being synchronized across all devices. This may take a few minutes depending on the amount of data. You can continue working while the sync completes in the background.</p>
</div>
</div>
With Action Button
Alerts that include an actionable button.
Update Available
A new version of the application is ready to install.
Deployment Successful
Your project has been deployed to production.
Payment Failed
Your payment method was declined. Please update your billing information.
<div class="vt-alert">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Update Available</h3>
<p class="vt-alert-description">A new version of the application is ready to install.</p>
<div class="vt-alert-actions">
<button class="vt-btn vt-btn-primary vt-btn-sm"><span>Update Now</span></button>
</div>
</div>
</div>
<div class="vt-alert vt-alert-success">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8 12.5L10 14.5L15.5 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Deployment Successful</h3>
<p class="vt-alert-description">Your project has been deployed to production.</p>
<div class="vt-alert-actions">
<button class="vt-btn vt-btn-bordered vt-btn-sm"><span>View Deployment</span></button>
</div>
</div>
</div>
<div class="vt-alert vt-alert-danger">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 8V12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Payment Failed</h3>
<p class="vt-alert-description">Your payment method was declined. Please update your billing information.</p>
<div class="vt-alert-actions">
<button class="vt-btn vt-btn-bordered vt-btn-sm"><span>Update Billing</span></button>
</div>
</div>
</div>
Closable
Alerts with a close button to dismiss them.
Tip
You can pin frequently used pages for faster access.
New Feature
Dark mode is now available! Toggle it from the settings page.
Storage Almost Full
You are using 90% of your storage. Consider upgrading your plan.
Connection Lost
Unable to connect to the server. Check your internet connection and try again.
<div id="alert-close-1" class="vt-alert vt-transition-all">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="11.9999" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 15.9999L12 11.9999" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M11.875 8.24994L12 8.24994M11.75 8.24994C11.75 8.11187 11.8619 7.99994 12 7.99994C12.1381 7.99994 12.25 8.11187 12.25 8.24994C12.25 8.38801 12.1381 8.49994 12 8.49994C11.8619 8.49994 11.75 8.38801 11.75 8.24994Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Tip</h3>
<p class="vt-alert-description">You can pin frequently used pages for faster access.</p>
</div>
<button onclick="document.getElementById('alert-close-1').style.display='none'" class="vt-btn vt-btn-ghost vt-btn-icon vt-btn-sm" aria-label="Dismiss">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
<path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
</button>
</div>
<div id="alert-close-2" class="vt-alert vt-alert-info vt-transition-all">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="11.9999" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 15.9999L12 11.9999" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M11.875 8.24994L12 8.24994M11.75 8.24994C11.75 8.11187 11.8619 7.99994 12 7.99994C12.1381 7.99994 12.25 8.11187 12.25 8.24994C12.25 8.38801 12.1381 8.49994 12 8.49994C11.8619 8.49994 11.75 8.38801 11.75 8.24994Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">New Feature</h3>
<p class="vt-alert-description">Dark mode is now available! Toggle it from the settings page.</p>
</div>
<button onclick="document.getElementById('alert-close-2').style.display='none'" class="vt-btn vt-btn-ghost vt-btn-icon vt-btn-sm" aria-label="Dismiss">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
<path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
</button>
</div>
<div id="alert-close-3" class="vt-alert vt-alert-warning vt-transition-all">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<path d="M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 9V13" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Storage Almost Full</h3>
<p class="vt-alert-description">You are using 90% of your storage. Consider upgrading your plan.</p>
</div>
<button onclick="document.getElementById('alert-close-3').style.display='none'" class="vt-btn vt-btn-ghost vt-btn-icon vt-btn-sm" aria-label="Dismiss">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
<path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
</button>
</div>
<div id="alert-close-4" class="vt-alert vt-alert-danger vt-transition-all">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-alert-icon" aria-hidden="true">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 8V12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<div class="vt-alert-content">
<h3 class="vt-alert-title">Connection Lost</h3>
<p class="vt-alert-description">Unable to connect to the server. Check your internet connection and try again.</p>
</div>
<button onclick="document.getElementById('alert-close-4').style.display='none'" class="vt-btn vt-btn-ghost vt-btn-icon vt-btn-sm" aria-label="Dismiss">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
<path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
</button>
</div>
Guidelines
Heads up
Your changes apply to all team members.
Error
There was a problem with your request.
Warning
Your trial expires soon.
Error
Payment failed.
Info
A new update is available.
Saved!
Your changes were saved.
API Reference
| Class | Type | Description |
|---|---|---|
vt-alert |
Base | Alert container — icon, content and dismiss in a row; rounded, bordered, 16px padding |
vt-alert-icon |
Part | Intent icon, 20px — as tall as the title line |
vt-alert-content |
Part | Title, description and actions stacked 4px apart; takes the rest of the row |
vt-alert-title |
Part | Title — Label/MD |
vt-alert-description |
Part | Description — Body/SM |
vt-alert-actions |
Part | Row of small buttons (vt-btn vt-btn-sm) under the description |
vt-btnvt-btn-ghostvt-btn-iconvt-btn-sm |
Part | Dismiss button (aria-label="Dismiss") |
vt-alert-info |
Variant | Blue tinted background and border for informational alerts |
vt-alert-success |
Variant | Green tinted background and border for success alerts |
vt-alert-warning |
Variant | Orange tinted background and border for warning alerts |
vt-alert-danger |
Variant | Red tinted background and border for error alerts |
Accessibility
| Feature | Details |
|---|---|
| Role | Use role="alert" for urgent messages that need immediate attention |
| Closable | Close button should have aria-label="Dismiss" for screen readers |
| Icons | Decorative icons should have aria-hidden="true", meaning conveyed by text |
| Focus | When alert appears dynamically, use aria-live="polite" for non-urgent updates |