Explanation
In the code above, we used the following classes to create the spinner:
spinner-border
: this is the main class that indicates that this is a spinner.
text-primary
: this sets the color of the spinner to the primary color of the theme.
sr-only
: this class hides the "Loading..." text from screen readers.
Use
Bootstrap Spinners can be used to indicate that content is being loaded asynchronously. They can be placed anywhere on the page that makes sense for the user experience, such as in a modal dialog or in a loading message on a page.
Important Points
- Bootstrap Spinners are animated loading indicators that can be used to show that content is being loaded asynchronously.
- Spinners can be customized with CSS classes to change their size, color, and style.
- Spinners are accessible by default with ARIA attributes.
Summary
Bootstrap Spinners provide a simple and elegant solution to indicating that content is being loaded asynchronously. By using Spinners, you can provide a better user experience by letting them know that something is happening and that they should wait a moment longer.