spinners.md 2.2 KB
Newer Older
C
chomik 已提交
1 2
---
title: Spinners
C
chomik 已提交
3
menu: docs.spinners
M
Martyna 已提交
4
description: Spinners are used to show the loading state of a component or page. They provide feedback for an action a user has taken, when it takes a bit longer to complete.
C
codecalm 已提交
5
bootstrap-link: components/spinners/
C
codecalm 已提交
6
done: true
C
chomik 已提交
7
---
M
Martyna 已提交
8
loading state of a component
C
chomik 已提交
9

C
codecalm 已提交
10

C
codecalm 已提交
11
## Default markup
C
chomik 已提交
12

M
Martyna 已提交
13 14
Use the default spinner to notify users that an action they have taken is in progress, helping them avoid confusion. 

C
codecalm 已提交
15
{% capture code %}
C
chomik 已提交
16
{% include ui/spinner.html %}
C
codecalm 已提交
17 18
{% endcapture %}
{% include example.html code=code %}
C
chomik 已提交
19 20


C
codecalm 已提交
21
## Colors
C
chomik 已提交
22

M
Martyna 已提交
23 24
Choose one of the available colors to customize the spinner and make it suit your design.

C
codecalm 已提交
25
{% capture code %}
C
chomik 已提交
26 27 28 29
{% for color in site.colors %}
{% assign c = color[0] %}
{% include ui/spinner.html color=c %}
{% endfor %}
C
codecalm 已提交
30 31
{% endcapture %}
{% include example.html code=code %}
C
chomik 已提交
32

C
codecalm 已提交
33

C
codecalm 已提交
34
## Size
C
chomik 已提交
35

M
Martyna 已提交
36 37
Choose the size of your spinner. You can use the default size or use the `spinner-border-sm` class to display a smaller spinner.

C
codecalm 已提交
38
{% capture code %}
C
chomik 已提交
39 40
{% include ui/spinner.html %}
{% include ui/spinner.html size="sm" %}
C
codecalm 已提交
41 42
{% endcapture %}
{% include example.html code=code %}
C
chomik 已提交
43

C
codecalm 已提交
44

C
codecalm 已提交
45
## Growing spinner
C
chomik 已提交
46

M
Martyna 已提交
47 48
Use the growing spinner, if you are looking for a more original design than a border spinner. The spinner grows to show the loading state. 

C
codecalm 已提交
49
{% capture code %}
C
chomik 已提交
50
{% include ui/spinner.html type="grow" %}
C
codecalm 已提交
51 52
{% endcapture %}
{% include example.html code=code %}
C
chomik 已提交
53

M
Martyna 已提交
54 55
Growing spinners also come in a variety of colors to choose from.

C
codecalm 已提交
56
{% capture code %}
C
chomik 已提交
57 58 59 60
{% for color in site.colors %}
{% assign c = color[0] %}
{% include ui/spinner.html color=c type="grow" %}
{% endfor %}
C
codecalm 已提交
61 62
{% endcapture %}
{% include example.html code=code %}
C
chomik 已提交
63

C
codecalm 已提交
64

C
codecalm 已提交
65
## Buttons
C
chomik 已提交
66

M
Martyna 已提交
67 68
Use buttons with spinners to notify users that an action they have taken by clicking the button is in progress and prevent them from clicking multiple times or giving up.  

C
codecalm 已提交
69
{% capture code %}
C
codecalm 已提交
70 71 72 73 74
{% include ui/button.html spinner=true text="Button" color="primary" %}
{% include ui/button.html spinner=true text="Button" color="danger" %}
{% include ui/button.html spinner=true text="Button" color="warning" %}
{% include ui/button.html spinner=true color="success" %}
{% include ui/button.html spinner=true color="secondary" %}
C
codecalm 已提交
75 76
{% endcapture %}
{% include example.html code=code %}