I want to change the color and text of my html element(typically a button) based on the database value received. Its a time series API and keeps sending the data continuously. Based on the value received, if value goes above +5%, button should change to red, within the range +1%to+5%, it should remain yellow and normal should remain green. How can i achieve it.
Multiple ways of doing this, for example:
You can use conditional visibility to show a different container with a different class on the element base on the value of the attribute