Basic
Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight required contextual classes
Solid
Use variant property to apply contextual colors
Solid
Fill variant property with outline-(color) to apply these variants
Solid
Fill variant property with label-(color) to apply these variants
Links
Use the Alert.Link component to quickly provide matching colored links within any alert.
Additional content
Alerts can also contain additional HTML elements like headings, paragraphs and dividers.
Well done!
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Well done!
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Whenever you need to, be sure to use margin utilities to keep things nice and tidy.
Icon
If you want to put icon into alert element, you can use icon property and fill it with your icon.
Dismissible alert
It’s possible to dismiss any alert inline. For the most basic use-case an uncontrolled component can provide the functionality wanted without the need to manage/control the state of the component. Alert.Uncontrolled does not require isOpen nor toggle props to work.
Well done!
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Whenever you need to, be sure to use margin utilities to keep things nice and tidy.