npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@asafarim/progress-bars

v1.3.0

Published

![npm version](https://img.shields.io/npm/v/@asafarim/progress-bars) ![GitHub release](https://img.shields.io/github/release/alisafari-it/progress-bars)

Readme

@asafarim/progress-bars

npm version GitHub release

A comprehensive React component library for displaying progress indicators with multiple styles and configurations. Built with TypeScript, styled with design tokens, and fully accessible.

Features

  • Multiple Progress Components: Linear, Circular, Vertical, Segmented, Step, and Spinner variants
  • Fully Accessible: ARIA attributes and semantic HTML for screen readers
  • Design Token Integration: Uses @asafarim/design-tokens for consistent styling
  • TypeScript Support: Full type safety with exported interfaces
  • Flexible Styling: CSS Modules with customizable sizes, tones, and animations
  • React 18+: Built for modern React with hooks support

Installation

npm install @asafarim/progress-bars

or with pnpm:

pnpm add @asafarim/progress-bars

Demo & Examples

Quick Start

LinearProgress

import { LinearProgress } from '@asafarim/progress-bars';
import '@asafarim/progress-bars/dist/style.css';

export function MyComponent() {
  return (
    <>
      {/* Determinate progress */}
      <LinearProgress value={65} />

      {/* Indeterminate loading state */}
      <LinearProgress variant="indeterminate" />

      {/* With striped animation */}
      <LinearProgress value={45} striped animated />
    </>
  );
}

CircularProgress

import { CircularProgress } from '@asafarim/progress-bars';

export function MyComponent() {
  return (
    <>
      {/* Determinate circular progress */}
      <CircularProgress value={75} size={80} showLabel />

      {/* Indeterminate spinner */}
      <CircularProgress size={56} />
    </>
  );
}

Components

LinearProgress

Horizontal progress bar with determinate and indeterminate variants.

Props:

  • variant?: 'determinate' | 'indeterminate' - Progress type (default: 'determinate')
  • size?: 'sm' | 'md' | 'lg' - Bar height (default: 'md')
  • tone?: ProgressTone - Color tone (default: 'brand')
  • value?: number - Current progress value (0-100, default: 0)
  • min?: number - Minimum value (default: 0)
  • max?: number - Maximum value (default: 100)
  • striped?: boolean - Show striped pattern (default: false)
  • animated?: boolean - Animate stripes (default: false)
  • thickness?: number - Custom track height in pixels
  • ariaLabel?: string - Accessible name
  • ariaLabelledBy?: string - ID of labeling element
  • ariaValueText?: string - Text for indeterminate state (default: 'Loading')

Usage Example:

<LinearProgress
  value={60}
  size="lg"
  tone="success"
  striped
  animated
  ariaLabel="File upload progress"
/>

CircularProgress

Circular progress indicator with optional label overlay.

Props:

  • value?: number - Progress percentage (0-100, undefined for indeterminate)
  • size?: number - SVG size in pixels (default: 56)
  • thickness?: number - Stroke width in pixels (default: 6)
  • tone?: ProgressTone - Color tone (default: 'brand')
  • label?: string - Accessible label
  • showLabel?: boolean - Display percentage text (default: false)
  • formatValue?: (value: number) => string - Custom value formatter

Usage Example:

<CircularProgress
  value={85}
  size={120}
  thickness={8}
  tone="success"
  showLabel
  formatValue={(v) => `${v}%`}
/>

VerticalProgress

Vertical progress bar (similar to LinearProgress but vertical orientation).

Props: Same as LinearProgress

Example:

<VerticalProgress value={50} size="lg" />

SegmentedProgress

Progress bar divided into discrete segments.

Props:

  • value?: number - Current progress value
  • segments?: number - Number of segments (default: 5)
  • tone?: ProgressTone - Color tone
  • size?: 'sm' | 'md' | 'lg' - Bar size

Example:

<SegmentedProgress value={3} segments={5} />

StepProgress

Multi-step progress indicator showing completion status.

Props:

  • steps?: Array<{ label: string; completed?: boolean }> - Step definitions
  • currentStep?: number - Current active step
  • tone?: ProgressTone - Color tone

Example:

<StepProgress
  steps={[
    { label: 'Step 1', completed: true },
    { label: 'Step 2', completed: true },
    { label: 'Step 3' }
  ]}
  currentStep={2}
/>

Spinner

Animated loading spinner.

Props:

  • size?: number - Size in pixels (default: 40)
  • tone?: ProgressTone - Color tone
  • ariaLabel?: string - Accessible label

Example:

<Spinner size={48} tone="brand" ariaLabel="Loading" />

ProgressTrack

Base component for custom progress implementations.

ProgressLabel

Label component for progress indicators.

ProgressLegend

Legend component for displaying progress information.

ProgressStack

Container for stacking multiple progress components.

Tones

Available color tones (from design tokens):

  • 'brand' - Primary brand color
  • 'success' - Success/positive state
  • 'warning' - Warning state
  • 'error' - Error/negative state
  • 'info' - Informational state

Styling

The package uses CSS Modules and design tokens for styling. Import the styles:

import '@asafarim/progress-bars/dist/style.css';

Styles are automatically scoped to components and use CSS custom properties from @asafarim/design-tokens.

Accessibility

All components include:

  • Proper ARIA roles and attributes
  • Semantic HTML structure
  • Keyboard navigation support
  • Screen reader friendly labels
  • Color-independent progress indication

Example with accessibility:

<LinearProgress
  value={50}
  ariaLabel="Download progress"
  ariaLabelledBy="progress-label"
/>
<div id="progress-label">Downloading file...</div>

TypeScript

Full TypeScript support with exported types:

import type {
  LinearProgressProps,
  CircularProgressProps,
  ProgressTone
} from '@asafarim/progress-bars';

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT

Author

Ali Safari [email protected]

Repository

GitHub

Homepage

Demo & Documentation