Notification Card

Communicate important information, status updates, or alerts to your users with this clear and accessible notification card.

This component is essential for any application or dashboard. It's designed to be easily adapted to different contexts, with pre-styled variations for information, success, warnings, and errors.

Screenshot showing four different notification cards for info, success, warning, and error states.

Get Source Code Preview

About this Component

This template uses a classic alert message pattern. An icon and a colored left border provide a strong visual cue for the notification's type, while the main content area provides a title and a descriptive message. The component's appearance is controlled entirely by a single modifier class.

Features

Code Breakdown

HTML Structure

Each notification is a simple div with the class .notification-card. You can then add a modifier class like .is-warning to apply a different style. Inside, the card is a flex container with a div element for the icon and a div for the text content. The text content includes an h3 element for the title and a p element for the message.

CSS Styling

The core styling uses a colored border-left and a light, tinted background-color to define the notification's look. This is all handled by the --notification-accent-color and --notification-bg-color variables. The modifier classes (e.g., .is-success) work by simply re-declaring these variables with different color values. The text colors inside the notification are then set based on these accent colors for a cohesive theme.

Code

Here is the complete, self-contained code. Simply choose the notification style you need and apply the corresponding class to the card element.

View Output