瀏覽代碼

Merge pull request #933 from zauberzeug/button_icons_demo

add icon demo for ui.button
Falko Schindler 2 年之前
父節點
當前提交
65dadf793d
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      website/more_documentation/button_documentation.py

+ 12 - 0
website/more_documentation/button_documentation.py

@@ -8,6 +8,18 @@ def main_demo() -> None:
 
 
 def more() -> None:
+    @text_demo('Icons', '''
+        You can also add an icon to a button.
+    ''')
+    async def icons() -> None:
+        with ui.row():
+            ui.button('demo').props('icon=history')
+            ui.button().props('icon=thumb_up')
+            with ui.button():
+                ui.label('sub-elements')
+                ui.image('https://picsum.photos/id/377/640/360') \
+                    .classes('rounded-full w-16 h-16 ml-4')
+
     @text_demo('Await button click', '''
         Sometimes it is convenient to wait for a button click before continuing the execution.
     ''')