Bootstrap 5 加载器

加载器

要创建 spinner/加载器,请使用 .spinner-border 类:

实例

<div class="spinner-border"></div>

亲自试一试

彩色加载器

请使用任意文本颜色 utilites 为 spinner 添加颜色:

实例

<div class="spinner-border text-muted"></div>
<div class="spinner-border text-primary"></div>
<div class="spinner-border text-success"></div>
<div class="spinner-border text-info"></div>
<div class="spinner-border text-warning"></div>
<div class="spinner-border text-danger"></div>
<div class="spinner-border text-secondary"></div>
<div class="spinner-border text-dark"></div>
<div class="spinner-border text-light"></div>

亲自试一试

增长的加载器

如果您希望 spinner/加载器增长而不是“旋转”,请使用 .spinner-grow 类:

实例

<div class="spinner-grow text-muted"></div>
<div class="spinner-grow text-primary"></div>
<div class="spinner-grow text-success"></div>
<div class="spinner-grow text-info"></div>
<div class="spinner-grow text-warning"></div>
<div class="spinner-grow text-danger"></div>
<div class="spinner-grow text-secondary"></div>
<div class="spinner-grow text-dark"></div>
<div class="spinner-grow text-light"></div>

亲自试一试

加载器大小

请使用 .spinner-border-sm.spinner-grow-sm 创建较小的加载器:

实例

<div class="spinner-border spinner-border-sm"></div>
<div class="spinner-grow spinner-grow-sm"></div>

亲自试一试

加载器按钮

您还可以向按钮添加加载器,无论是否带有文本:

实例

<button class="btn btn-primary">
  <span class="spinner-border spinner-border-sm"></span>
</button>

<button class="btn btn-primary">
  <span class="spinner-border spinner-border-sm"></span>
  Loading..
</button>

<button class="btn btn-primary" disabled>
  <span class="spinner-border spinner-border-sm"></span>
  Loading..
</button>

<button class="btn btn-primary" disabled>
  <span class="spinner-grow spinner-grow-sm"></span>
  Loading..
</button>

亲自试一试