Progress bar
Shows how much of a limit or total has been used, such as plan usage or test coverage.
Default
Without a title, only the bar renders.
<.progress_bar value={68} max={100} />
With title
The header shows the title, the current value, and the maximum.
<.progress_bar value={142} max={200} title="Remote cache hits:" />
Formatted values
value_label
and
max_label
replace the numbers shown in the header.
<.progress_bar
value={3_650_722_816}
max={10_737_418_240}
value_label="3.4 GB"
max_label="10 GB"
title="Cache egress:"
/>
<.progress_bar
value={18_420}
max={50_000}
value_label="18.4K"
max_label="50K"
title="Passing test cases:"
/>
Over the limit
A value above the maximum fills the bar without overflowing it.
<.progress_bar
value={1_240}
max={1_000}
value_label="1,240"
max_label="1,000"
title="Runner minutes:"
/>
With description
The
description
slot renders below the bar.
<.progress_bar value={142} max={200} title="Remote cache hits:">
<:description>
<.link_button
href="https://tuist.dev/pricing"
label="Learn more about remote cache hits"
variant="primary"
size="medium"
underline
/>
</:description>
</.progress_bar>
Guidelines
-
Pass integers for
valueandmax. The bar fills tovalue / maxand stops at full whenvalueis larger. -
Add a
titleto show the header with the current value and the maximum. Without a title, only the bar renders. -
Use
value_labelandmax_labelto format large numbers or sizes for the reader. The bar still measures itself withvalueandmax. -
Use the
descriptionslot for a short explanation or a link below the bar.
API reference
<.progress_bar>
| Attribute | Type | Default | Description |
|---|---|---|---|
|
max
Required
|
integer
|
–
|
Maximum value.
|
|
max_label
|
string
|
nil
|
Text to show in place of
max
. See
value_label
.
|
|
title
|
string
|
nil
|
The title of the progress bar
|
|
value
Required
|
integer
|
–
|
The current value.
|
|
value_label
|
string
|
nil
|
Text to show in place of
value
. The bar still measures itself with
value
, so this is for presentation only: formatting a large count
for the reader without making the geometry depend on a string.
|
Also accepts global attributes.
| Slot | Description |
|---|---|
|
:description
|
|