Skip to content

Unable to remove class "bg-primary" from button #1445

Answered by falkoschindler
groucho86 asked this question in Q&A
Discussion options

You must be logged in to vote

The default background color of a button is not generated with a class but with a prop. Therefore removing "bg-primary" does not work.
If you want to set the background color to a different value you can use

ui.button('Click me!', color='white')

or

ui.button('Click me!').props('color=red')

or for a button without background

ui.button('Click me!').props('flat')

Note that these solutions yield different button text colors, also depending on whether you run in dark or light mode.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by groucho86
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1443 on August 18, 2023 05:40.