---
-title: Alerts
+title: Alert
description: Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
toc: true
+aliases:
+ - /docs/[[config:docs_version]]/components/alerts/
---
import { getData } from '@libs/data'
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.
-<Example addStackblitzJs code={`<div id="liveAlertPlaceholder"></div>
-<button type="button" class="btn btn-primary" id="liveAlertBtn">Show live alert</button>`} />
+<Example addStackblitzJs class="d-flex flex-column align-items-start gap-3" code={`<div id="liveAlertPlaceholder"></div>
+<button type="button" class="btn-solid theme-primary flex-grow-0" id="liveAlertBtn">Show live alert</button>`} />
We use the following JavaScript to trigger our live alert demo:
Use the `.alert-link` utility class to quickly provide matching colored links within any alert.
-<Example code={getData('theme-colors').map((themeColor) => `<div class="alert alert-${themeColor.name}" role="alert">
+<Example code={getData('theme-colors').map((themeColor) => `<div class="alert theme-${themeColor.name}" role="alert">
A simple ${themeColor.name} alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>`)} />
Alerts can also contain additional HTML elements like headings, paragraphs and dividers.
-<Example code={`<div class="alert alert-success" role="alert">
+<Example code={`<div class="alert theme-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>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.</p>
<hr>
Similarly, you can use [flexbox utilities]([[docsref:/utilities/flex]]) and [Bootstrap Icons]([[config:icons]]) to create alerts with icons. Depending on your icons and content, you may want to add more utilities or custom styles.
-<Example code={`<div class="alert alert-primary d-flex align-items-center" role="alert">
+<Example code={`<div class="alert theme-primary d-flex align-items-center" role="alert">
<svg xmlns="http://www.w3.org/2000/svg" class="bi flex-shrink-0 me-2" viewBox="0 0 16 16" role="img" aria-label="Warning:">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg>
</symbol>
</svg>
- <div class="alert alert-primary d-flex align-items-center" role="alert">
+ <div class="alert theme-primary d-flex align-items-center" role="alert">
<svg class="bi flex-shrink-0 me-2" role="img" aria-label="Info:"><use href="#info-fill"/></svg>
<div>
An example alert with an icon
</div>
</div>
- <div class="alert alert-success d-flex align-items-center" role="alert">
+ <div class="alert theme-success d-flex align-items-center" role="alert">
<svg class="bi flex-shrink-0 me-2" role="img" aria-label="Success:"><use href="#check-circle-fill"/></svg>
<div>
An example success alert with an icon
</div>
</div>
- <div class="alert alert-warning d-flex align-items-center" role="alert">
+ <div class="alert theme-warning d-flex align-items-center" role="alert">
<svg class="bi flex-shrink-0 me-2" role="img" aria-label="Warning:"><use href="#exclamation-triangle-fill"/></svg>
<div>
An example warning alert with an icon
</div>
</div>
- <div class="alert alert-danger d-flex align-items-center" role="alert">
+ <div class="alert theme-danger d-flex align-items-center" role="alert">
<svg class="bi flex-shrink-0 me-2" role="img" aria-label="Danger:"><use href="#exclamation-triangle-fill"/></svg>
<div>
An example danger alert with an icon
You can see this in action with a live demo:
-<Example code={`<div class="alert alert-warning alert-dismissible fade show" role="alert">
+<Example code={`<div class="alert theme-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<CloseButton dismiss="alert" />
</div>`} />
title: Spinners
description: Indicate the loading state of a component or page with Bootstrap spinners, built entirely with HTML, CSS, and no JavaScript.
toc: true
+aliases:
+ - /docs/[[config:docs_version]]/components/spinners/
---
import { getData } from '@libs/data'
Border spinner variables:
-<ScssDocs name="spinner-border-css-vars" file="scss/_spinners.scss" />
+<ScssDocs name="spinner-border-css-vars" file="scss/_spinner.scss" />
Growing spinner variables:
-<ScssDocs name="spinner-grow-css-vars" file="scss/_spinners.scss" />
+<ScssDocs name="spinner-grow-css-vars" file="scss/_spinner.scss" />
For both spinners, small spinner modifier classes are used to update the values of these CSS variables as needed. For example, the `.spinner-border-sm` class does the following:
-<ScssDocs name="spinner-border-sm-css-vars" file="scss/_spinners.scss" />
+<ScssDocs name="spinner-border-sm-css-vars" file="scss/_spinner.scss" />
### Sass variables
-<ScssDocs name="spinner-variables" file="scss/_spinners.scss" />
+<ScssDocs name="spinner-variables" file="scss/_spinner.scss" />
### Keyframes
-Used for creating the CSS animations for our spinners. Included in `scss/_spinners.scss`.
+Used for creating the CSS animations for our spinners. Included in `scss/_spinner.scss`.
-<ScssDocs name="spinner-border-keyframes" file="scss/_spinners.scss" />
+<ScssDocs name="spinner-border-keyframes" file="scss/_spinner.scss" />
-<ScssDocs name="spinner-grow-keyframes" file="scss/_spinners.scss" />
+<ScssDocs name="spinner-grow-keyframes" file="scss/_spinner.scss" />
[color]: [[docsref:/utilities/colors]]
[flex]: [[docsref:/utilities/flex]]