Loading animation
Bootstrap 5 Loading animation component
Responsive loading animation built with Bootstrap 5. Enhance user experience with intuitive, responsive loading animations for seamless web design.
Icons
Basic example
Use the border spinners for a lightweight loading indicator.
MDB “spinners” can be used to show the loading state in your projects. They’re built only with HTML and CSS, meaning you don’t need any JavaScript to create them. You will, however, need some custom JavaScript to toggle their visibility. Their appearance, alignment, and sizing can be easily customized with our amazing utility classes.
For accessibility purposes, each loader here includes
role="status"
and a nested
<span class="visually-hidden">Loading...</span>
.
Colors
The border spinner uses currentColor
for its border-color
, meaning
you can customize the color with
text color utilities. You can use any of
our text color utilities on the standard spinner.
Why not use border-color
utilities?:
Each border spinner specifies a transparent
border for at least one side, so
.border-{color}
utilities would override that.
Loading management
Basic example
Loading is automatically initialized on page load if you add the data-mdb-loading-init
attribute to your element.
By default, Loading attaches to the body element. If you want to attach Loading to a specific element, you need to
add data-mdb-parent-selector
with the class or ID of your parent. Alternatively, you can achieve this via
JavaScript using the parentSelector
option.
JavaScript init
You can initialize the Loading component in JavaScript using the constructor:
new Loading(element, options)
.
Colors
You can set a different colors to loader with color utilities for example .text-primary
.