noora
Sign in

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.

Remote cache hits: 142 200
<.progress_bar value={142} max={200} title="Remote cache hits:" />

Formatted values

value_label and max_label replace the numbers shown in the header.

Cache egress: 3.4 GB 10 GB
Passing test cases: 18.4K 50K
<.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.

Runner minutes: 1,240 1,000
<.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.

Remote cache hits: 142 200
Learn more about remote cache hits
<.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 value and max . The bar fills to value / max and stops at full when value is larger.
  • Add a title to show the header with the current value and the maximum. Without a title, only the bar renders.
  • Use value_label and max_label to format large numbers or sizes for the reader. The bar still measures itself with value and max .
  • Use the description slot 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