A way to bind the color of a button #5511
Replies: 3 comments 3 replies
-
|
Hello @borolepratik thanks for the observation. I think the lack of binding support may be due to the complex logic nature of the colors: Check the source code: nicegui/nicegui/elements/mixins/color_elements.py Lines 20 to 43 in faa3375 There is 3 code paths, depending whether it is quasar color, Tailwind color, or CSS color, all setting in 3 different places. But this does sound like an interesting challenge to me 🤔 |
Beta Was this translation helpful? Give feedback.
-
|
Depending on what exactly you're trying to achieve, you can bind the color of a button: b = ui.button('Button', color=None)
ui.select(['red', 'green', 'blue'], value='red').bind_value_to(b.props, 'color') |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to bind the
colorof a button along withenabledandtext. I dont see abind_colormethod available, but are there any other levers i can pull to bind the color of the button to nicegui storage?Beta Was this translation helpful? Give feedback.
All reactions