![]() |
VOOZH | about |
Bootstrap 5 Alerts Icons are used to add icons to the alert bar to format the bar and make it more informative. To include the icon using <svg> tag we have to define its path inside the <path> tag in svg tag. We also need to specify its height and width to adjust its size according to the notification size.
Alert Icons Classes: No special classes are used in Alerts Icons. You can customize the List using Bootstrap icon classes and style them with flexbox utilities. (We must include the bootstrap 5 icons CSS file)
Alert icon Attributes(for svg tag only):
Syntax:
<div class="alert alert-...> // To display icon using i tag <i class="bi bi-..."></i> </div> // To display icon using svg tag <svg width="..." height="..." fill="..." class="bi bi-"> <path d="..."> </svg>
Example 1: The following code demonstrates the Alert Icons using the svg tag.
Output:
👁 Bootstrap 5 Alerts IconsExample 2: The following code demonstrates multiple icons using the Bootstrap 5 Alert properties with the help of <i> tag.
Output:
👁 Bootstrap 5 Alerts IconsReference: https://getbootstrap.com/docs/5.0/components/alerts/#icons