File size: 1,540 Bytes
e841ba5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import gradio as gr
import modelscope_studio.components.antd as antd
import modelscope_studio.components.base as ms

with gr.Blocks() as demo:
    with ms.Application():
        with antd.ConfigProvider():
            with antd.Radio():
                ms.Text("Radio")
            antd.Divider("Radio Group")
            with antd.Radio.Group():
                with antd.Radio(group_value=1):
                    ms.Text("A")
                with antd.Radio(group_value=2):
                    ms.Text("B")
                with antd.Radio(group_value=3):
                    ms.Text("C")
                with antd.Radio(group_value=4):
                    ms.Text("D")
            antd.Divider("Configuring Options")
            antd.Radio.Group(option_type="button",
                             button_style="solid",
                             options=[
                                 {
                                     "label": 'Apple',
                                     "value": 'Apple'
                                 },
                                 {
                                     "label": 'Pear',
                                     "value": 'Pear'
                                 },
                                 {
                                     "label": 'Orange',
                                     "value": 'Orange',
                                     "disabled": True
                                 },
                             ])
if __name__ == "__main__":
    demo.queue().launch()