How to set badge on checkbox? #3218
-
QuestionFrom https://nicegui.io/documentation/badge, badge can be set on button. with ui.button('Warning!'):
badge = ui.badge('!', color='red').props('floating') However, when I set badge on checkbox, it seems not working. It will be set on outside context, not on target checkbox. with ui.card():
with ui.checkbox('Warning!'):
badge = ui.badge('!', color='red').props('floating')
ui.checkbox('Select') |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jun 14, 2024
Replies: 1 comment 3 replies
-
That's unexpected! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In your example the checkbox is pretty wide, which you can verify by adding a border or background color to
ui.checkbox
. You can bring it back to its original size and stay left-aligned using the "justify-items-start" class: