You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,79 +19,131 @@ For accessibility purposes, each loader here includes `role="status"` and a nest
19
19
20
20
Use the border spinners for a lightweight loading indicator.
21
21
22
-
## Basic usage
23
-
24
22
```jsx preview
25
-
<CSpinner/>
23
+
<CSpinner/>
26
24
```
27
25
28
26
### Colors
29
27
30
28
The border spinner uses `currentColor` for its `border-color`. You can use any of our text color utilities on the standard spinner.
31
29
32
30
```jsx preview
33
-
<CSpinner color="primary"/>
34
-
<CSpinner color="secondary"/>
35
-
<CSpinner color="success"/>
36
-
<CSpinner color="danger"/>
37
-
<CSpinner color="warning"/>
38
-
<CSpinner color="info"/>
39
-
<CSpinner color="light"/>
40
-
<CSpinner color="dark"/>
31
+
<CSpinner color="primary"/>
32
+
<CSpinner color="secondary"/>
33
+
<CSpinner color="success"/>
34
+
<CSpinner color="danger"/>
35
+
<CSpinner color="warning"/>
36
+
<CSpinner color="info"/>
37
+
<CSpinner color="light"/>
38
+
<CSpinner color="dark"/>
41
39
```
42
40
43
41
## Growing spinner
44
42
45
43
If you don't fancy a border spinner, switch to the grow spinner. While it doesn't technically spin, it does repeatedly grow!
46
44
47
45
```jsx preview
48
-
<CSpinner variant="grow"/>
46
+
<CSpinner variant="grow"/>
49
47
```
50
48
51
49
Once again, this spinner is built with `currentColor`, so you can easily change its appearance. Here it is in blue, along with the supported variants.
52
50
53
51
```jsx preview
54
-
<CSpinner color="primary" variant="grow"/>
55
-
<CSpinner color="secondary" variant="grow"/>
56
-
<CSpinner color="success" variant="grow"/>
57
-
<CSpinner color="danger" variant="grow"/>
58
-
<CSpinner color="warning" variant="grow"/>
59
-
<CSpinner color="info" variant="grow"/>
60
-
<CSpinner color="light" variant="grow"/>
61
-
<CSpinner color="dark" variant="grow"/>
52
+
<CSpinner color="primary" variant="grow"/>
53
+
<CSpinner color="secondary" variant="grow"/>
54
+
<CSpinner color="success" variant="grow"/>
55
+
<CSpinner color="danger" variant="grow"/>
56
+
<CSpinner color="warning" variant="grow"/>
57
+
<CSpinner color="info" variant="grow"/>
58
+
<CSpinner color="light" variant="grow"/>
59
+
<CSpinner color="dark" variant="grow"/>
60
+
```
61
+
62
+
## Alignment
63
+
64
+
CoreUI React spinners are built with `rems`, `currentColor`, and `display: inline-flex`. This means they can easily be resized, recolored, and quickly aligned.
65
+
66
+
### Margin
67
+
68
+
Use [margin utilities](https://coreui.io/docs/utilities/spacing/#margin-and-padding) like `.m-5` for easy spacing.
69
+
70
+
```jsx preview
71
+
<CSpinner className="m-5"/>
72
+
```
73
+
74
+
### Placement
75
+
76
+
Use [flexbox utilities][https://coreui.io/docs/utilities/flex/], [float utilities][https://coreui.io/docs/utilities/float/], or [text alignment][https://coreui.io/docs/utilities/text/] utilities to place spinners exactly where you need them in any situation.
77
+
78
+
#### Flex
79
+
80
+
```jsx preview
81
+
<div className="d-flex justify-content-center">
82
+
<CSpinner />
83
+
</div>
84
+
```
85
+
86
+
```jsx preview
87
+
<div className="d-flex align-items-center">
88
+
<strong role="status">Loading...</strong>
89
+
<CSpinner className="ms-auto"/>
90
+
</div>
91
+
```
92
+
93
+
#### Floats
94
+
95
+
```jsx preview
96
+
<div className="clearfix">
97
+
<CSpinner className="float-end"/>
98
+
</div>
99
+
```
100
+
101
+
#### Text align
102
+
103
+
```jsx preview
104
+
<div className="text-center">
105
+
<CSpinner />
106
+
</div>
62
107
```
63
108
64
109
## Size
65
110
66
-
Add `size="sm"`property` to make a smaller spinner that can quickly be used within other components.
111
+
Add `size="sm"`property to make a smaller spinner that can quickly be used within other components.
67
112
68
113
```jsx preview
69
-
<CSpinner size="sm"/>
70
-
<CSpinner size="sm" variant="grow"/>
114
+
<CSpinner size="sm"/>
115
+
<CSpinner size="sm" variant="grow"/>
116
+
```
117
+
118
+
Or, use custom CSS or inline styles to change the dimensions as needed.
Use spinners within buttons to indicate an action is currently processing or taking place. You may also swap the text out of the spinner element and utilize button text as needed.
For both spinners, small spinner modifier classes are used to update the values of these CSS variables as needed. For example, the `.spinner-border-sm` class does the following:
`{breakpoint}={{ gutterX: * }}` props can be used to control the horizontal gutter widths. The `<CContainer>` or `<CContainer fluid>` parent may need to be adjusted if larger gutters are used too to avoid unwanted overflow, using a matching padding utility. For example, in the following example we've increased the padding with `.px-4`:
@@ -52,20 +52,20 @@ An alternative solution is to add a wrapper around the `<CRow>` with the `.overf
52
52
53
53
`{breakpoint}={{ gutterY: * }}` props can be used to control the vertical gutter widths. Like the horizontal gutters, the vertical gutters can cause some overflow below the `<CRow>` at the end of a page. If this occurs, you add a wrapper around `<CRow>` with the `.overflow-hidden` class:
@@ -75,20 +75,20 @@ An alternative solution is to add a wrapper around the `<CRow>` with the `.overf
75
75
76
76
`{breakpoint}={{ gutter: * }}` props can be used to control the horizontal gutter widths, for the following example we use a smaller gutter width, so there won't be a need to add the `.overflow-hidden` wrapper class.
@@ -98,38 +98,38 @@ An alternative solution is to add a wrapper around the `<CRow>` with the `.overf
98
98
99
99
Gutter props can also be added to [row columns](../layout/grid#row-columns). In the following example, we use responsive row columns and responsive gutter props.
@@ -143,13 +143,27 @@ The gutters between columns in our predefined grid props can be removed with `{b
143
143
144
144
In practice, here's how it looks. Note you can continue to use this with all other predefined grid props (including column widths, responsive tiers, reorders, and more).
0 commit comments