Skip to content
Vy logo
  • Identitet
  • Spor
  • Resources
Components

ProgressBar

A progress bar shows how far in a process the user has come.

FigmaGitHub

Examples

A ProgressBar with a given progress percentage

<ProgressBar 
  value={50} 
  marginY={3} 
  maxWidth="300px" 
/>

A labeled ProgressBar

<ProgressBar 
  value={30} 
  label="Betaler"
  marginY={3}
  maxWidth="300px"
/>

An inactive ProgressBar

<ProgressBar 
  value={50} /* Doesn't matter what value is here when the isActive is set to false */ 
  marginY={3} 
  isActive={false} 
  maxWidth="300px" 
/>

A ProgressBar with texts that changes every 5 seconds

<ProgressBar 
  value={30)
  label={["Kontakter bank", "Verifiserer", "Straks ferdig"]} 
  marginY={3}
  maxWidth="300px"
/>

Guidelines

Progress bars provide a more precise indication of how much remains to be loaded. They should be used in situations where it is important to give the user an accurate progress update. Examples include downloading large files, loading pages with heavy content, uploading files, or performing conversions.

If the waiting time is unknown, consider using a content loader or a spinner instead.

Code

<ProgressBar />

import { ProgressBar } from "@vygruppen/spor-react";

Shows determinate progress

Props

Name
Type
Required?
Description
valuenumberValue between 0 and 100 (as a percentage)
labelstring | string[]Description of what's happening. If an array is passed, the texts are rotated every `labelRotationDelay`seconds
labelRotationDelaynumberDelay in milliseconds. Default 5000 (5 seconds)
aria-labelstringRequired if you don't pass a label
heightstringDefault 0.5rem
isActivebooleanDefaults to true. Used to make the ProgressBar inactive.
showValueTextbooleanUsed to display the percentage of progress completed in the progress bar