john_helt
john_helt2mo ago

Change color of element programatically

I want to give a hint to the user, that they need to press a submit button, if they have made changes to some parts of the inputs. To do this, I want to nudge them by changing the color of the button to red. I tried with callout, but it seems a bit excessive as it just places a large box around my element. Instead I want to make it more subtle, but still visibly different from the standard button color
2 Replies
Hall
Hall2mo ago
Someone will reply to you shortly. In the meantime, this might help:
Myles Scolnick
Myles Scolnick2mo ago
there is a "kind" arg on the button that you pass:
kinds = ["neutral", "success", "warn", "danger"]
mo.vstack([mo.ui.button(label=kind, kind=kind) for kind in kinds])
kinds = ["neutral", "success", "warn", "danger"]
mo.vstack([mo.ui.button(label=kind, kind=kind) for kind in kinds])

Did you find this page helpful?