The Progress Bar color change ?.


I need help I have a progress bar that is connected to the database so I want help with a code where when the data update is less than 30-39the bar should be red and when is 50-70 turn yellow and 80-100 turn green please is for my school Assignment

alex rock

You will want to look at the API documentation here for how to update the style$w/progressbar/style

Hello @alexrock12379 ,

You should use a simple if statement against the value you want to check and update the color accordingly.

Here’s a simple example:

if (value >= 50 && value <= 70) {
    color = 'yellow'

if (value >= 80 && value <= 100) {
    color = 'green'

You can use the link @AmandaM gave you to read the component’s API and how to change its style.

Thanks for the additional context on the implementation in case they need it💪