Skip to content

Instantly share code, notes, and snippets.

@evnchn
Created March 12, 2025 01:25
Show Gist options
  • Select an option

  • Save evnchn/621d61ddb364b44b98dcc031a15cf8bc to your computer and use it in GitHub Desktop.

Select an option

Save evnchn/621d61ddb364b44b98dcc031a15cf8bc to your computer and use it in GitHub Desktop.
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