Spaces:
Running
Running
File size: 1,800 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 |
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.Space(size=16, wrap=True):
with antd.Avatar():
with ms.Slot("icon"):
antd.Icon("UserOutlined")
with antd.Avatar():
ms.Text('U')
with antd.Avatar(shape="square"):
ms.Text("USER")
antd.Avatar(
"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
)
with antd.Avatar():
with ms.Slot("src"):
antd.Image(
"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg",
alt="avatar")
with antd.Avatar(elem_style=dict(backgroundColor='#fde3cf',
color='#f56a00')):
ms.Text("U")
with antd.Avatar(elem_style=dict(backgroundColor='#87d068')):
with ms.Slot("icon"):
antd.Icon("UserOutlined")
antd.Divider("With Badge")
with antd.Space(size=24):
with antd.Badge(count=1):
with antd.Avatar(shape="square"):
with ms.Slot("icon"):
antd.Icon("UserOutlined")
with antd.Badge(dot=True):
with antd.Avatar(shape="square"):
with ms.Slot("icon"):
antd.Icon("UserOutlined")
if __name__ == "__main__":
demo.queue().launch()
|