Alerts are used to communicate important information to the user. They can be used to inform users about service changes, provide feedback to user actions or communicate general information. Alerts should be short, clear and easy to understand. Icons and colour should be used to help convey content and urgency. The alert will expand to the width of the content, up until the width of its parent element, at which point it will wrap.
npm install @nib-components/alert
import Alert from '@nib-components/alert';
Important Information about you cover
|string||Can be one of |
|string||The alert title.|
|boolean||To set the alert to span the full width of its parent container.|
|string||The alert variation. Can be one of |
|boolean||The alert background. Only works when the |
|node||The rest of the contents of the alert, — the "message".|
Colour and icons are used to help convey the content and urgency of the alert.
Avoid using colour alone as people with visual acuity or colour blindness may skip over this important information. This is why we use icons too.
type prop provides a number of Alert variations, each conveying a different meaning to the user.
Your last name is missing.
There are two variations available for the Alerts:
The loud variation is used by default and can be seen in the example below. This is most frequently used for system notifications and urgent information that needs to stand out as much as possible.
Where possible, we recommend using our more modern alert where possible; the
The soft variation should be used for providing contextual information and general notifications.
This component also comes with a
background prop which can be either
light (a light version of the type's colour).
All alerts should have a title, which should be short and descriptive.
An alert message is optional and if included should also be short and descriptive. An alert message can include links that redirect the user to further information or next steps.