Circular Progress Bar Using SVG | HTML | CSS | JS
ฝัง
- เผยแพร่เมื่อ 15 ก.ย. 2024
- Let's learn how to create a SVG circular progress bar using HTML, CSS and few lines of JavaScript code. Don't forget to like, share and subscribe if you found the video helpful.
Other videos from this channel:
/ @uicode
theuicode.com
/ theuicode
Source code:
github.com/ui-...
It took me a few days to find a reasonable tutorial explaining how to make a circular progress bar. Thanks a lot mate!
Glad I could help!🙌
Great video. Very simple and easy to understand. Keep up the good work. Looking forward to see more tutorials from you.
Milos Mladenovic Glad you liked
If you set the pathLength attribute on your circle element to "100" and set progress circle's dynamic stroke-dasharray to `${percent} 100`, you don't need to worry about the complex math with circumference & pixels. Just use the straight percent and SVG will figure out the length in pixels for you.
Thanks for that tip, I wasn't aware. I'll try that out😃
yo acobster thank you for the tip!! all these people and you are the only one with the best solution
helped me alot. what i was looking for. Thanks alot!!!
Glad it helped!
great video
this is really nice, even though looks very tricky, but what is not tricky is css? XD
thanks for the great work, the simplest explanation ever for svg Circular Progress. but if i need to add percentage counter in the middle how could i do that?
Thanks. Just wrap svg with another div or span to show the value in the middle. Here's the gist: gist.github.com/ui-code/c9f8609010369c880648e217c4c17d0c
@@UICode thank you so much
Thank's a lot for the simplified /easy code for progress bar. can i know your vscode light theme name?
Thank you. The theme is FlatUI : marketplace.visualstudio.com/items?itemName=lkytal.FlatUI
Thanks
how to animate to fill the strok dash? like the percentage from 0 to 60% to be filled?
Just add transition property and make little change in the code. It will work. I have quickly updated the code for you. Check it out: gist.github.com/ui-code/c031581536867e8b8968f134d02989fb
Thanks for this tutorial. I am trying to make multiple progress bars but it's showing an error. Would you please help me?
You need to create a reusable component by using this code and use it multiple times as you need. Which framework are you using?
probably instead of querySelector, you should use querySelectorAll and go through a loop
firstly, Thank you for your effort.But I am still struggling. I write the same code as you do but still I don't get the result. It shows always 100%
Hey..check out the link to source code in the description. You can correct it by referring the code.
how to write 50% inside the circle
Check out this updated gist : gist.github.com/ui-code/c9f8609010369c880648e217c4c17d0c
thank you
in this shall we add three to four circular progress at once
Make a half circle guide
How can we make this responsive?
Use media queries or responsive libraries like tailwind css or bootstrap.