File size: 4,674 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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.Avatar.Group():
                antd.Avatar(
                    value="https://api.dicebear.com/7.x/miniavs/svg?seed=1")
                with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
                    ms.Text("K")
                with antd.Tooltip(title="Ant User", placement="top"):
                    with antd.Avatar(elem_style=dict(
                            backgroundColor="#87d068")):
                        with ms.Slot("icon"):
                            antd.Icon("UserOutlined")
                with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
                    with ms.Slot("icon"):
                        antd.Icon("AntDesignOutlined")

            antd.Divider()

            with antd.Avatar.Group(max=dict(
                    count=2,
                    style=dict(color="#f56a00", backgroundColor="#fde3cf"))):
                antd.Avatar(
                    value="https://api.dicebear.com/7.x/miniavs/svg?seed=2")
                with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
                    ms.Text("K")
                with antd.Tooltip(title="Ant User", placement="top"):
                    with antd.Avatar(elem_style=dict(
                            backgroundColor="#87d068")):
                        with ms.Slot("icon"):
                            antd.Icon("UserOutlined")
                with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
                    with ms.Slot("icon"):
                        antd.Icon("AntDesignOutlined")

            antd.Divider()

            with antd.Avatar.Group(size="large",
                                   max=dict(count=2,
                                            style=dict(
                                                color="#f56a00",
                                                backgroundColor="#fde3cf"))):
                antd.Avatar(
                    value="https://api.dicebear.com/7.x/miniavs/svg?seed=3")
                with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
                    ms.Text("K")
                with antd.Tooltip(title="Ant User", placement="top"):
                    with antd.Avatar(elem_style=dict(
                            backgroundColor="#87d068")):
                        with ms.Slot("icon"):
                            antd.Icon("UserOutlined")
                with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
                    with ms.Slot("icon"):
                        antd.Icon("AntDesignOutlined")

            antd.Divider()

            with antd.Avatar.Group(size="large",
                                   max=dict(count=2,
                                            style=dict(
                                                color="#f56a00",
                                                backgroundColor="#fde3cf",
                                                cursor="pointer"),
                                            popover=dict(trigger="click"))):
                antd.Avatar(
                    value=
                    "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
                )
                with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
                    ms.Text("K")
                with antd.Tooltip(title="Ant User", placement="top"):
                    with antd.Avatar(elem_style=dict(
                            backgroundColor="#87d068")):
                        with ms.Slot("icon"):
                            antd.Icon("UserOutlined")
                with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
                    with ms.Slot("icon"):
                        antd.Icon("AntDesignOutlined")

            antd.Divider()

            with antd.Avatar.Group(shape="square"):
                with antd.Avatar(elem_style=dict(backgroundColor="#fde3cf")):
                    ms.Text("A")
                with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
                    ms.Text("K")
                with antd.Avatar(elem_style=dict(backgroundColor="#87d068")):
                    with ms.Slot("icon"):
                        antd.Icon("UserOutlined")
                with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
                    with ms.Slot("icon"):
                        antd.Icon("AntDesignOutlined")
if __name__ == "__main__":
    demo.queue().launch()