Command palette

@yasinsensoy/web

Web · Components

Progress

Progress bar.

2 exports

Live example

Preview

Loading66%

Code

import { Progress } from "@yasinsensoy/web";

<Progress value={66} label="Loading" showValue />

Events

  1. Events appear here when you interact with the preview.

Import

import { Progress } from "@yasinsensoy/web";

Progress

componentServer component

Progress bar. It is a server component; since the bar moves with transform, value changes don't relayout the page.

Progress({ value, max, label, showValue, valueText, tone, size, className, ...props }: ProgressProps): JSX.Element

Examples

<Progress value={40} label="Upload" showValue />
<Progress value={3} max={10} label="Files" showValue="3 / 10" tone="success" />
<Progress aria-label="Preparing" /> // indeterminate

ProgressProps

interface

Props of the Progress component.

Extends: Omit<ComponentProps<"div">, "children">

NameTypeDefaultDescription
value?number | nullCompleted amount (0 – max). If omitted or null, the duration is shown as indeterminate (sliding bar).
max?number100Maximum value.
label?ReactNodeLabel shown above the bar; screen readers read the bar by this name. If you don't want a visible label, pass aria-label instead.
showValue?boolean | ReactNodeShows the value right of the label: the percentage when true, or the given text or element (e.g. "3 / 10 files").
valueText?stringValue text read to screen readers (e.g. "3 / 10 files"). If omitted, the percentage is read.
tone?Tone"primary"Color.
size?keyof typeof sizeClasses"md"Thickness.