Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Scroll Indicator in React

Prompt

Build a reading progress scroll indicator — a thin colored bar at the top of the page that fills from 0% to 100% width as the user scrolls from top to bottom. Common in blogs and articles. Formula: scrollPercentage = (scrollTop / (scrollHeight - clientHeight)) * 100.

Add scroll event listener in useEffect on window or a container ref. Calculate scrollPercentage = (winScroll
Test Results

Scroll Indicator in React

Build a reading progress scroll indicator — a thin colored bar at the top of the page that fills from 0% to 100% width as the user scrolls from top to bottom. Common in blogs and articles. Formula: scrollPercentage = (scrollTop / (scrollHeight - clientHeight)) * 100.