React Alert is prepared for any length of text, as well as an optional close button. For a styling, use one of the required contextual color
props (e.g., primary
). For inline dismissal, use the dismissing prop.
A simple primary alert—check it out!
A simple secondary alert—check it out!
A simple success alert—check it out!
A simple danger alert—check it out!
A simple warning alert—check it out!
A simple info alert—check it out!
A simple light alert—check it out!
A simple dark alert—check it out!
Conveying meaning to assistive technologiesUsing color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .visually-hidden
class.
Click the button below to show an alert (hidden with inline styles to start), then dismiss (and destroy) it with the built-in close button.
Link color#Use the <CAlertLink>
component to immediately give matching colored links inside any react alert component.
A simple secondary alert with
an example link. Give it a click if you like.
Additional content#React Alert can also incorporate supplementary components & elements like heading, paragraph, and divider.
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.
Icons#Similarly, you can use flexbox utilities and CoreUI Icons to create react alerts with icons. Depending on your icons and content, you may want to add more utilities or custom styles.
An example alert with an icon
Need more than one icon for your react alerts? Consider using CoreUI Icons.
An example alert with an icon
An example success alert with an icon
An example warning alert with an icon
An example danger alert with an icon
Solid#Use variant="solid"
to change contextual colors to solid.
A simple solid primary alert—check it out!
A simple solid secondary alert—check it out!
A simple solid success alert—check it out!
A simple solid danger alert—check it out!
A simple solid warning alert—check it out!
A simple solid info alert—check it out!
A simple solid light alert—check it out!
A simple solid dark alert—check it out!
Dismissing#React Alert component can also be easily dismissed. Just add the dismissible
prop.
Go right ahead and click that dimiss over there on the right.
When an alert is dismissed, the element is completely removed from the page structure. If a keyboard user dismisses the alert using the close button, their focus will suddenly be lost and, depending on the browser, reset to the start of the page/document.
API#Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4