Displays a callout for user attention — informational, success, warning, or error.
Information
Your account settings have been updated successfully.
Success
Your project was published and is now live.
Warning
You are approaching your storage limit.
Error
Unable to save changes. Check your connection.
<div class="alert alert-info"> <span class="material-icons-round alert-icon">info</span> <div> <div class="alert-title">Information</div> <div class="alert-desc">Your account settings have been updated.</div> </div> </div>
Installation
Built with pure HTML and CSS. Include ds-shared.css in your project.
pnpm add @norbielink/ds
Usage
Import
<link rel="stylesheet" href="ds-shared.css">
Basic structure
<div class="alert alert-info"> <span class="material-icons-round alert-icon">info</span> <div> <div class="alert-title">Title</div> <div class="alert-desc">Description text here.</div> </div> </div>
Examples
Inline with dismiss button
New version v2.4.0 is available.
Password changed successfully.
<div class="alert alert-info" style="align-items:center;"> <span class="material-icons-round alert-icon">info</span> <div style="flex:1"> <div class="alert-title">New version available.</div> </div> <span class="material-icons-round" style="font-size:18px;color:#2980B9;cursor:pointer;">close</span> </div>
API Reference
Variant classes
| Class | Color | Use case |
|---|---|---|
alert-info | Blue (#2980B9) | Informational messages |
alert-success | Green (#1D9E6B) | Success confirmations |
alert-warning | Amber (#E6A817) | Warnings and cautions |
alert-error | Red (#C0392B) | Errors and failures |
Dark variants
| Class | Notes |
|---|---|
alert-dk alert-info-dk | Dark info variant |
alert-dk alert-success-dk | Dark success variant |
alert-dk alert-warning-dk | Dark warning variant |
alert-dk alert-error-dk | Dark error variant |