Created
March 12, 2025 01:25
-
-
Save evnchn/621d61ddb364b44b98dcc031a15cf8bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from nicegui import ui | |
| class my_widget: | |
| def __init__(self, name, value): | |
| self.name = name | |
| self.value = value | |
| self.container = ui.row() | |
| self.create_widget() | |
| def create_widget(self): | |
| with self.container: | |
| ui.input(label=self.name, placeholder='fichier de propriétés', value=self.value).props('dense').classes('w-[51.667px]') # avoid relative width | |
| ui.switch(text='var', value=True).props('dense') | |
| ui.button('Edit') | |
| with ui.row(): # no need gap-0 since the root cause is solved | |
| my_widget('wid1', 'toto') | |
| my_widget('wid2', 'tata') | |
| ui.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment