Progress Bar

Markdown

A progress bar component to display single or stacked progress indicators.

<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full">
  <ProgressBar.Root variant="muted" value={0.5} className="w-48" />
</Flex>

Anatomy

<ProgressBar.Root>
  <ProgressBar.Fill />
</ProgressBar.Root>

Examples

Variants

Progress bar components come with three built in variants, solid, outlined, and muted.

Solid

Outlined

Muted

<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full">
  {["solid", "outlined", "muted"].map((variant) => (
    <Box key={variant} className="flex flex-col gap-2">
      <Text>{variant.charAt(0).toUpperCase() + variant.slice(1)}</Text>
      <ProgressBar.Root variant={variant} value={0.5} className="w-48" />
    </Box>
  ))}
</Flex>

Sizes

To manage the size of the progress bar you can provide a size through the size prop.

XS

SM

MD

LG

XL

<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full">
  {["xs", "sm", "md", "lg", "xl"].map((size) => (
    <Box key={size} className="flex flex-col gap-2">
      <Text>{size.toUpperCase()}</Text>
      <ProgressBar.Root
        size={size}
        value={0.5}
        variant="muted"
        className="w-48"
      />
    </Box>
  ))}
</Flex>

Colors

The progress bar component uses the color prop to allow for predefined and custom colors.

Primary

Secondary

Tertiary

Success

Danger

Warning

Info

<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full">
  {[
    "primary",
    "secondary",
    "tertiary",
    "success",
    "danger",
    "warning",
    "info",
  ].map((color) => (
    <Box key={color} className="flex flex-col gap-2">
      <Text>{color.charAt(0).toUpperCase() + color.slice(1)}</Text>
      <ProgressBar.Root
        value={0.5}
        color={color}
        variant="muted"
        className="w-48"
      />
    </Box>
  ))}
</Flex>

Stacking

Use ProgressBar.Fill children to create stacked progress bars with multiple segments.

<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full">
  <ProgressBar.Root className="w-48" variant="solid" size="xl">
    <ProgressBar.Fill value={0.3} color="primary" />
    <ProgressBar.Fill value={0.2} color="secondary" />
    <ProgressBar.Fill value={0.1} color="tertiary" />
  </ProgressBar.Root>
</Flex>

Over Stacking

When stacked fill values exceed 1, the progress bar gracefully handles overflow.

<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full">
  <ProgressBar.Root className="w-48" variant="solid" size="xl">
    <ProgressBar.Fill value={0.5} color="primary" />
    <ProgressBar.Fill value={0.4} color="secondary" />
    <ProgressBar.Fill value={0.3} color="tertiary" />
  </ProgressBar.Root>
</Flex>