SVG#
您可以使用 ui.html
元素添加可缩放矢量图形。
from nicegui import ui
content = '''
<svg viewBox="0 0 200 200" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="100" r="78" fill="#ffde34" stroke="black" stroke-width="3" />
<circle cx="80" cy="85" r="8" />
<circle cx="120" cy="85" r="8" />
<path d="m60,120 C75,150 125,150 140,120" style="fill:none; stroke:black; stroke-width:8; stroke-linecap:round" />
</svg>'''
ui.html(content)
# ui.run()
<nicegui.elements.html.Html at 0x7f83b6247790>