@ryvora/react-progress
v2.1.0
Published
πβ³ Accessible and customizable progress bar for React. Show your users their progress!
Maintainers
Readme
Progress πβ³
Hello Progress Tracker! π
The progress module helps you create accessible and good-looking progress bars. Whether you're showing file upload progress, a setup wizard's completion, or just how much of a task is done, this component has got you covered! πͺ
It's like a little visual cheerleader π£ for your users, showing them how far they've come and how close they are to the finish line!
Key Features:
- β
Accessible: Implements ARIA attributes for progress bars (
aria-valuenow,aria-valuemin,aria-valuemax). - π’ Determinate & Indeterminate: Supports both known progress values and an "I'm working on it!" indeterminate state.
- π¨ Styleable: Easily customizable to fit your app's look and feel.
- π§© Composable: Typically consists of
Progress.Root(the container) andProgress.Indicator(the part that fills up).
Basic Usage:
import * as Progress from '@ryvora/react-progress';
import React, { useState, useEffect } from 'react';
function MyLoadingComponent() {
const [progressValue, setProgressValue] = useState(0);
useEffect(() => {
// Simulate progress
if (progressValue < 100) {
const timer = setTimeout(() => setProgressValue(progressValue + 10), 500);
return () => clearTimeout(timer);
}
}, [progressValue]);
return (
<div>
<p>Loading... {progressValue}%</p>
<Progress.Root value={progressValue} max={100} style={{ width: '300px', height: '20px' }}>
<Progress.Indicator
style={{ width: `${progressValue}%`, height: '100%', backgroundColor: 'green' }}
/>
</Progress.Root>
{/* Indeterminate example */}
{/* <Progress.Root value={null} style={{ width: '300px', height: '20px' }}> */}
{/* <Progress.Indicator style={{ width: '50%', height: '100%', backgroundColor: 'blue' }} /> */}
{/* </Progress.Root> */}
</div>
);
}Show that progress and keep your users in the loop! ππ
