@molecule/app-progress-bar-react

Feature · progress-bar · App (browser) · v4.1.1 · Apache-2.0

React labeled progress bar with card wrapper

npm install @molecule/app-progress-bar-react

npm · Source on GitHub

How it works

@molecule/app-progress-bar-react is a ready-made progress-bar feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { ProgressBar, ProgressCard } from '@molecule/app-progress-bar-react'

<ProgressBar value={65} label="Upload progress" valueLabel="65%" color="primary" />

<ProgressCard
  title="Storage used"
  description="8.5 GB of 10 GB"
  value={85}
  valueLabel="85%"
  color="warning"
/>

Works with: @molecule/app-react, @molecule/app-ui, @molecule/app-ui-react

Reference

React labeled progress bar and progress-card wrapper.

Exports:

  • <ProgressBar> — standalone bar with optional label + value display.
  • <ProgressCard> — <Card>-wrapped progress display (title, icon, description, bar, optional extras slot).

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { ProgressBar, ProgressCard } from '@molecule/app-progress-bar-react'

<ProgressBar value={65} label="Upload progress" valueLabel="65%" color="primary" />

<ProgressCard
  title="Storage used"
  description="8.5 GB of 10 GB"
  value={85}
  valueLabel="85%"
  color="warning"
/>

Type

feature

Installation

npm install @molecule/app-progress-bar-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
npm install -D @types/react

API

Interfaces

ProgressBarProps

Props for ProgressBar.

interface ProgressBarProps {
  /** Current numeric value. */
  value: number
  /** Maximum (defaults to 100). */
  max?: number
  /** Optional label rendered above the track. */
  label?: ReactNode
  /** Optional value display rendered on the right of the label row. */
  valueLabel?: ReactNode
  /**
   * Element id the track is named by (`aria-labelledby`). Wins over `label`
   * and the default accessible name — `ProgressCard` points it at its title.
   */
  labelledBy?: string
  /** Element id the track is described by (`aria-describedby`). */
  describedBy?: string
  /** Size preset — maps to ClassMap `progressHeight`. */
  size?: 'sm' | 'md' | 'lg'
  /** Color variant — maps to ClassMap `progressColor`. */
  color?: 'primary' | 'success' | 'warning' | 'error' | 'info'
  /** Extra classes on the outer wrapper. */
  className?: string
}

ProgressCardProps

Props for ProgressCard.

interface ProgressCardProps {
  title: ReactNode
  /** Optional supporting description below the title. */
  description?: ReactNode
  /** Optional icon shown in the card header. */
  icon?: ReactNode
  /** Current value. */
  value: number
  /** Maximum (defaults to 100). */
  max?: number
  /** Value display on the right of the header (e.g. "73%"). */
  valueLabel?: ReactNode
  /** ProgressBar color. */
  color?: 'primary' | 'success' | 'warning' | 'error' | 'info'
  /** Extra classes on the Card wrapper. */
  className?: string
  /** Additional content rendered below the bar. */
  children?: ReactNode
}

Functions

ProgressBar(props)

Labeled progress bar with optional value display.

Renders a [label ... valueLabel] header row above a track. The track itself uses the wired ClassMap progress tokens — swap the ClassMap bond to restyle without touching this component.

The track always carries an accessible name (aria-progressbar-name): labelledBy when given, else the rendered label, else t('progressBar.label', undefined, { defaultValue: 'Progress' }).

function ProgressBar({
  value,
  max = 100,
  label: labelProp,
  valueLabel: valueLabelProp,
  labelledBy,
  describedBy,
  size = 'md',
  color = 'primary',
  className,
}: ProgressBarProps): JSX.Element
  • props — Component props (see ProgressBarProps).

ProgressCard(props)

<Card>-wrapped progress display with title, optional icon and description, the progress bar itself, and an optional extras slot below. Useful for budget/goal cards, storage-used panels, onboarding progress, etc.

The bar is named by the title (aria-labelledby) and, when a description renders, described by it (aria-describedby).

function ProgressCard({
  title,
  description: descriptionProp,
  icon,
  value,
  max = 100,
  valueLabel: valueLabelProp,
  color = 'primary',
  className,
  children,
}: ProgressCardProps): JSX.Element
  • props — Component props (see ProgressCardProps).

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-react ^4.13.0 || ^5.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-react ^4.4.0
  • react ^18.0.0 || ^19.0.0

Runtime Dependencies

  • @molecule/app-react
  • @molecule/app-ui
  • @molecule/app-ui-react
  • react

All visible text (label, valueLabel, title, description) is pass-through — supply already-translated strings. The track's fallback accessible name resolves through t('progressBar.label', undefined, { defaultValue: 'Progress' }), so a locale bond can translate it; a rendered label or a labelledBy id names it instead. Requires a wired ClassMap bond: the track/fill styles come from the progress* ClassMap tokens, so colors follow the active theme.

Translations

Translation strings are provided by @molecule/app-locales-progress-bar.