Progress

How far a task has got, as a bar or a ring, with a label and its value, or a sweep while the amount is unknown.

Ready to import
x

Duplicates merge by email address.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/progress

Usage

import { Progress } from "./ui/uicontext/components/Progress.ts"
export const UploadProgress = <M>(h: Html.H<M>, sent: number) =>	Progress(h, { label: "Uploading 3 of 5 files", value: sent })

Examples

Limits and tones

The tone says how close a limit is. Words carry the value when a percentage isn't the clearest.

Automation runs
x
Storage
x
Seats
x

Progress circle

A ring for cards and rows. A small one keeps its label for screen readers only.

Workspace setupx
Syncing calendarx
Indexing the repositoryx
Uploading roadmap.pdfx

API reference

ProgressView function

Options

Progress options
NameTypeDefaultDescription
keystring—Names the bar among others in the same view; needed for more than one
valuerequirednumber | null—How far along, from min to max, or null while the amount is unknown.
minnumber00 by default.
maxnumber100100 by default.
labelrequiredstring—What's in progress: "Uploading 3 of 5 files". Shown above the bar, and its name.
hideLabelboolean—Hide the label but keep it as the bar's name, for a bar whose meaning is plain from where it sits.
valueTextstring—The value as words, when a percentage isn't the clearest: "8 of 10 GB".
showValuebooleantrueShow the value beside the label; true by default.
size"sm" | "md" | "lg"mdThe bar's thickness; md by default.
tone"accent" | "success" | "warning" | "danger" | "info"accentIts color, by what it means; accent by default. Use danger for a quota nearly used up.
styleStyle—StyleX styles applied after the bar's own.

ProgressCircleView function

Options

ProgressCircle options
NameTypeDefaultDescription
size"sm" | "md" | "lg"mdsm (20px) sits in a row of text, md (40px) in a card, lg (64px) leads a panel; md by default.
showLabelbooleantrueShow the label and the value beside the ring; true by default. Without it the label still names the ring for a screen reader.

Source