Skip to content

ProgressBar ​

Terminal progress bar with determinate and indeterminate (animated bounce) modes. Auto-sizes to available width.

Import ​

tsx
import { ProgressBar } from "silvery"

Usage ​

tsx
// Determinate — shows filled progress
<ProgressBar value={0.5} />

// Indeterminate — animated bouncing block
<ProgressBar />

// With label and color
<ProgressBar value={0.75} color="green" label="Downloading..." />

Props ​

PropTypeDefaultDescription
valuenumber—Progress 0-1 (omit for indeterminate animation)
widthnumberavailable widthWidth in columns
fillCharstring"█"Character for the filled portion
emptyCharstring"░"Character for the empty portion
showPercentagebooleantrue for determinateShow percentage label
labelstring—Label text before the bar
colorstring—Color of the filled portion

Modes ​

Determinate ​

When value is provided (0-1), the bar shows a filled portion proportional to the value.

Downloading... ████████████░░░░░░░░░░░░░░░░░░  40%

Indeterminate ​

When value is omitted, the bar shows an animated bouncing block that moves back and forth.

Loading... ░░░░░░████░░░░░░░░░░░░░░░░░░░░

Examples ​

Download Progress ​

tsx
<ProgressBar value={bytesReceived / totalBytes} label="Downloading..." color="$primary" />

File Processing ​

tsx
<Box flexDirection="column" gap={1}>
  <Text>
    Processing files ({processed}/{total})
  </Text>
  <ProgressBar value={processed / total} />
</Box>

Indeterminate Loading ​

tsx
<ProgressBar label="Connecting..." />

Custom Characters ​

tsx
<ProgressBar value={0.6} fillChar="=" emptyChar="-" showPercentage={false} />

Output: ============------------------