Let me create a reusable progress bar component for your React TypeScript project using Tailwind CSS.
The progress bar component I've created includes:
Customizable Properties:
value
: The current progress valuemax
: The maximum value (defaults to 100)showValue
: Option to display the current valuelabel
: Optional text labelsize
: Three size options (sm, md, lg)color
: Five color variants (primary, secondary, success, warning, danger)className
: For additional custom stylingAccessibility:
Responsive Design:
Interactive Demo:
Import the component and use it in your React components:
import ProgressBar from "@/components/progress-bar";
// Basic usage
<ProgressBar value={50} />
// With all options
<ProgressBar
value={75}
max={100}
showValue={true}
label="Download Progress"
size="lg"
color="success"
className="my-4"
/>
The demo page shows various examples of how to configure and use the progress bar in different scenarios.