Menu

Bootstrap 5 Spinners


Previous


Next

Spinners

To create a spinner/loader, use the .spinner-border class:

Example

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link href=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css” rel=”stylesheet”>
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js”></script>
</head>
<body>

<div>
<h2>Spinners</h2>
<p>To create a spinner/loader, use the <code>.spinner-border</code> class:</p>

<div></div>
</div>

</body>
</html>

Colored Spinners

Use any text color utilites to add a color to the spinner:

Example

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link href=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css” rel=”stylesheet”>
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js”></script>
</head>
<body>

<div>
<h2>Colored Spinners</h2>
<p>Use any <strong>text color utilites</strong> to add a color to the spinner:</p>

<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>

</body>
</html>

Growing Spinners

Use the .spinner-grow class if you want the spinner/loader to grow instead of “spin”:

 

Example

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link href=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css” rel=”stylesheet”>
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js”></script>
</head>
<body>

<div>
<h2>Growing Spinners</h2>
<p>Use the <code>.spinner-grow</code> class if you want the spinner/loader to grow instead of “spin”:</p>

<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>

</body>
</html>

Spinner Size

Use .spinner-border-sm or .spinner-grow-sm to create a smaller spinner:

Example

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link href=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css” rel=”stylesheet”>
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js”></script>
</head>
<body>

<div>
<h2>Spinner Size</h2>
<p>Use <code>.spinner-border-sm</code> or <code>.spinner-grow-sm</code> to create a smaller spinner:</p>

<div></div>
<div></div>
</div>

</body>
</html>

Spinner Buttons

You can also add spinners to a button, with or without text:

Example

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link href=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css” rel=”stylesheet”>
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js”></script>
</head>
<body>

<div>
<h2>Spinner Buttons</h2>
<p>Add spinners to buttons:</p>

<button>
<span></span>
</button>

<button>
<span></span>
Loading..
</button>

<button disabled>
<span></span>
Loading..
</button>

<button disabled>
<span></span>
Loading..
</button>
</div>

</body>
</html>


Previous


Next

Scroll to Top