I have a Shiny for Python app with some buttons. I want to change the color of a button. How can I do this?
from shiny.express import ui
with ui.layout_columns():
ui.input_action_button("red_button", "Make this button red!")
ui.input_action_button("blue_button", "Make this button blue!")
You can pass a style attribute and set the background-color:
from shiny.express import ui
with ui.layout_columns():
ui.input_action_button(
"red_button",
"Make this button red!",
style = "background-color: red;"
)
ui.input_action_button(
"blue_button",
"Make this button blue!",
style = "background-color: lightblue;"
)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With