Tinyrack

Progress

Determinate and indeterminate task progress with size and semantic status axes.

Contract

AxisValuesDefault
variantneutral, info, success, warning, dangerneutral
uiSizemd, lgmd
partsRoot, Label, Track, Indicator, Valuecompound API

Install

pnpm add @tinyrack/ui

Scroll inside the code area to read long lines.

Styles

@import '@tinyrack/ui/components/progress.css';

Scroll inside the code area to read long lines.

Imports

import { TRProgress } from '@tinyrack/ui/components/progress';

Scroll inside the code area to read long lines.

Playground

Usage

Examples

Sizes permalink

Choose a track thickness that fits the surrounding layout. Size does not communicate task importance.

Semantic variants permalink

Set the variant from task meaning; Progress does not infer status from the numeric value.

Custom range and formatting permalink

The visual fill, visible value, and accessible value text all share the same 0–64 GB range.

API

Base UI supplies value semantics. Pass null for indeterminate progress so aria-valuenow is omitted; the moving indicator is disabled under reduced motion.

Root

PropTypeDefaultPurpose
valuenumber | nullrequiredCurrent value; null selects indeterminate progress
minnumber0Range minimum
maxnumber100Range maximum
formatIntl.NumberFormatOptionsFormats Value and the default accessible value text
localeIntl.LocalesArgumentruntime localeLocale used by Intl.NumberFormat
getAriaValueText(formattedValue, value) => stringbuilt inCustomizes aria-valuetext
uiSizemd | lgmdTrack thickness
variantneutral | info | success | warning | dangerneutralSemantic fill color
renderBase UI render prop<div>Replaces the native root while preserving behavior

TRProgressStatus is 'indeterminate' | 'progressing' | 'complete'. Root and every part also accept their native props, className, style, and ref.

Parts

PartDefault elementPurpose
RootdivAccessible progressbar and shared range context
LabelspanVisible accessible name
TrackdivFull range surface
IndicatordivDeterminate fill or indeterminate motion
ValuespanFormatted, visually displayed value

Tokens

CSS tokenDefaultPurpose
--tr-progress-background--tinyrack-surface-mutedTrack surface
--tr-progress-fillsemantic variant colorIndicator fill
--tr-progress-heightsize recipeTrack thickness
--tr-progress-radius--tinyrack-radius-fullTrack radius
--tr-progress-duration--tinyrack-duration-normalDeterminate width transition
--tr-progress-easing--tinyrack-ease-outDeterminate easing
--tr-progress-indeterminate-duration--tinyrack-duration-loadingIndeterminate cycle
--tr-progress-indeterminate-easing--tinyrack-ease-linearIndeterminate easing
--tr-progress-indeterminate-width40%Moving indicator measure