Progress Bar II
You're given a task to display a list of progress bars with different percentage values (10%, 20%, ..., 100%). Each progress bar should:
-
Animate to the given percentage after a delay of 1 second.
-
Visually fill the bar based on the percentage using a CSS
transform. -
Display the numeric progress as text (e.g., "20%").
-
Show the text color as:
- Black if progress is less than 5%.
- White otherwise.
-
Have a green background and smooth animation using CSS transitions.
You are provided with two components:
App.js: Renders a list of ProgressBar components.ProgressBar.js: A single progress bar that updates after 1 second usinguseEffect.
Your Task:
- The progress bar text updates from
0%to the correct percentage after 100 ms. - The visual fill (via
transform: translateX(...)) corresponds to the progress value. - The background color is green.
- Text color should be white > 5 % else black.
- The transition style is smooth (
transition: 0.5s ease-in). - The update happens with a delay of 100ms.
- It is mandatory for the ProgressBar to have role="progressbar" so it can be properly identified and tested for accessibility and styling.
Reference UI

Companies:
Solve Similar questions 🔥
Want to upskill? Explore our courses!
Namaste DSA
Master DSA from scratch with numerous problems, and expert guidance.
Namaste React
Wanna dive deep into React and become Frontend Expert? Learn with me now!
Namaste Frontend System Design
The most comprehensive and detailed course for frontend system design.
Namaste Node.js
Wanna dive deep into Node.js? Enroll into `Namaste Node.js` now!
