Socket
Socket
Sign inDemoInstall

@react-aria/progress

Package Overview
Dependencies
Maintainers
2
Versions
724
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/progress

Spectrum UI components in React


Version published
Weekly downloads
737K
increased by5.43%
Maintainers
2
Weekly downloads
 
Created

Package description

What is @react-aria/progress?

@react-aria/progress is a library that provides accessible progress indicators for React applications. It is part of the React Aria collection of hooks and components that help build accessible web applications.

What are @react-aria/progress's main functionalities?

ProgressBar

The ProgressBar component provides a visual representation of progress. It uses the useProgressBar hook to manage accessibility attributes and the useProgressBarState hook to manage the state of the progress bar.

import { useProgressBar } from '@react-aria/progress';
import { useProgressBarState } from '@react-stately/progress';

function ProgressBar(props) {
  let { progressBarProps } = useProgressBar(props);
  let state = useProgressBarState(props);

  return (
    <div {...progressBarProps} style={{ width: '100%', backgroundColor: '#e0e0e0' }}>
      <div style={{ width: `${state.value}%`, backgroundColor: '#0078d4', height: '100%' }} />
    </div>
  );
}

CircularProgress

The CircularProgress component provides a circular progress indicator. It uses the useProgressCircle hook for accessibility and the useProgressCircleState hook to manage the state of the circular progress.

import { useProgressCircle } from '@react-aria/progress';
import { useProgressCircleState } from '@react-stately/progress';

function CircularProgress(props) {
  let { progressCircleProps } = useProgressCircle(props);
  let state = useProgressCircleState(props);

  return (
    <svg {...progressCircleProps} viewBox="0 0 100 100" width="100" height="100">
      <circle cx="50" cy="50" r="45" fill="none" stroke="#e0e0e0" strokeWidth="10" />
      <circle
        cx="50"
        cy="50"
        r="45"
        fill="none"
        stroke="#0078d4"
        strokeWidth="10"
        strokeDasharray={Math.PI * 2 * 45}
        strokeDashoffset={Math.PI * 2 * 45 * (1 - state.value / 100)}
      />
    </svg>
  );
}

Other packages similar to @react-aria/progress

Readme

Source

@react-aria/progress

This package is part of react-spectrum. See the repo for more details.

FAQs

Package last updated on 09 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc