Browse Source

add demo for multi-select

Rodja Trappe 1 year ago
parent
commit
0e1d04ae6e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      website/more_documentation/select_documentation.py

+ 10 - 0
website/more_documentation/select_documentation.py

@@ -25,3 +25,13 @@ def more() -> None:
         ]
         ui.select(options=continents, with_input=True,
                   on_change=lambda e: ui.notify(e.value)).classes('w-40')
+
+    @text_demo('Multi selection', '''
+        You can activate `multiple` to allow the selection of more than one item.
+    ''')
+    def multi_select():
+        names = ['Alice', 'Bob', 'Carol']
+        ui.select(names, multiple=True, label='comma-separated') \
+            .classes('w-64')
+        ui.select(names, multiple=True, label='with chips') \
+            .props('use-chips').classes('w-64')