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
@@ -16,42 +16,49 @@ Progress components are built with two HTML elements, some CSS to set the width,
16
16
## Basic usage
17
17
18
18
```jsx preview
19
-
<CProgress className="mb-3">
20
-
<CProgressBar value={0}/>
21
-
</CProgress>
22
-
<CProgress className="mb-3">
23
-
<CProgressBar value={25}/>
24
-
</CProgress>
25
-
<CProgress className="mb-3">
26
-
<CProgressBar value={50}/>
27
-
</CProgress>
28
-
<CProgress className="mb-3">
29
-
<CProgressBar value={75}/>
30
-
</CProgress>
31
-
<CProgress className="mb-3">
32
-
<CProgressBar value={100}/>
33
-
</CProgress>
19
+
<CProgress value={0} />
20
+
<CProgress value={25} />
21
+
<CProgress value={50} />
22
+
<CProgress value={75} />
23
+
<CProgress value={100} />
34
24
```
35
25
36
26
## Labels
37
27
38
28
Add labels to your progress bars by placing text within the `<CProgressBar>`.
39
29
40
30
```jsx preview
41
-
<CProgress className="mb-3">
42
-
<CProgressBar value={25}>25%</CProgressBar>
31
+
<CProgress value={25}>25%</CProgress>
32
+
```
33
+
34
+
Please note that the default setting for the content within the `<CProgressBar />` is to be limited by the `overflow: hidden property`, preventing it from extending beyond the bar's boundaries. If the progress bar is shorter than its label, the content will be truncated and could be difficult to read. To modify this behavior, you can utilize the `.overflow-visible` class from the overflow utilities. However, it is important to specify a specific text color to ensure readability. It's worth noting that this approach currently does not consider color modes.
35
+
36
+
```jsx preview
37
+
<CProgress value={10}>
38
+
<CProgressBar className="overflow-visible text-dark px-2" color="success">Long label text for the progress bar, set to a dark color</CProgressBar>
43
39
</CProgress>
44
40
```
45
41
42
+
Since **v4.9.0** you can also use the `progressBarClassName` property directly on the `<CProgress />` component to achieve the same.
43
+
44
+
```jsx
45
+
<CProgress progressBarClassName="overflow-visible text-dark px-2" color="success" value={10}>Long label text for the progress bar, set to a dark color</CProgress>
46
+
```
47
+
46
48
## Height
47
49
48
50
We only set a `height` value on the `<CProgress>`, so if you change that value the inner `<CProgressBar>` will automatically resize accordingly.
49
51
50
52
```jsx preview
51
-
<CProgress height={1} className="mb-3">
53
+
<CProgress height={1} value={25} />
54
+
<CProgress height={20} value={25} />
55
+
```
56
+
57
+
```jsx preview
58
+
<CProgress height={1}>
52
59
<CProgressBar value={25}></CProgressBar>
53
60
</CProgress>
54
-
<CProgress height={20} className="mb-3">
61
+
<CProgress height={20}>
55
62
<CProgressBar value={25}></CProgressBar>
56
63
</CProgress>
57
64
```
@@ -61,26 +68,60 @@ We only set a `height` value on the `<CProgress>`, so if you change that value t
61
68
Use `color` prop to change the appearance of individual progress bars.
62
69
63
70
```jsx preview
64
-
<CProgress className="mb-3">
65
-
<CProgressBar color="success" value={25}/>
71
+
<CProgress color="success" value={25} />
72
+
<CProgress color="info" value={50} />
73
+
<CProgress color="warning" value={75} />
74
+
<CProgress color="danger" value={100} />
75
+
```
76
+
77
+
Ensure that when you incorporate labels into progress bars featuring a custom background color, you also select an appropriate text color to ensure readability and maintain adequate contrast for the labels.
Include multiple progress bars in a progress component if you need.
105
+
Include multiple progress bars in a progress component if you need. In **v4.9.0**
106
+
107
+
<Calloutcolor="info"title="New markup in v4.9.0">
108
+
In version 4.9.0, we introduced a new `<CProgressStacked>` component to more logically wrap multiple progress bars into a single stacked progress bar. The previous structure will continue to work until the next major version.
109
+
</Callout>
110
+
111
+
112
+
**New markup**
81
113
82
114
```jsx preview
83
-
<CProgress className="mb-3">
115
+
<CProgressStacked>
116
+
<CProgress value={15} />
117
+
<CProgress color="success" value={30} />
118
+
<CProgress color="info" value={20} />
119
+
</CProgressStacked>
120
+
```
121
+
122
+
**Previous markup**
123
+
```jsx
124
+
<CProgress>
84
125
<CProgressBar value={15} />
85
126
<CProgressBar color="success" value={30} />
86
127
<CProgressBar color="info" value={20} />
@@ -92,37 +133,22 @@ Include multiple progress bars in a progress component if you need.
92
133
Add `variant="striped"` to any `<CProgressBar>` to apply a stripe via CSS gradient over the progress bar's background color.
0 commit comments