How to build a Circle Progress from scratch with React

Jair Orlando Huaman Bellido
2 min readMar 11, 2022

As a frontend developer, we investigate libraries relates to data visualization in order to display statistics in our projects. In this article, I will show how to implement a circle progress with React + Typescript.

Steps:

  1. Styling the background
  2. Circle mask
  3. Circle progress
  4. React component

1. Styling the background

This styles is for this example, feel free to change it to your liking 😉.

styles.css

2. Circle mask

In this step, we’ll create the circle mask with the following features:

  • Radius: 100
  • Stroke width: 10
  • Stroke color: rgba(255,255,255,0.1)
Circle Mask

3. Circle progress

Let’s show up the progress 🚀

Circle Progress
Circle progress CSS
Circle Progress

4. React component

Finally, we will put everything together and create the component which will receive as 2 parameters: percentage and color.

Mask
Progress
CircleProgress.tsx
circle.css

We pass the following props:

  • percentage: 70
  • fill: #28fca4
App.tsx
Final result

If you enjoyed this article, please share with your friends and a virtual clap👏 for more posts.

Thank you!

--

--