from nicegui import ui
from ..tools import load_demo, text_demo
def content() -> None:
load_demo(ui.image)
@text_demo('Captions and Overlays', '''
By nesting elements inside a `ui.image` you can create augmentations.
Use [Quasar classes](https://quasar.dev/vue-components/img) for positioning and styling captions.
To overlay an SVG, make the `viewBox` exactly the size of the image and provide `100%` width/height to match the actual rendered size.
''')
def captions_and_overlays_demo():
with ui.image('https://picsum.photos/id/29/640/360'):
ui.label('Nice!').classes('absolute-bottom text-subtitle2 text-center')
with ui.image('https://cdn.stocksnap.io/img-thumbs/960w/airplane-sky_DYPWDEEILG.jpg'):
ui.html('''
''').classes('bg-transparent')
load_demo(ui.interactive_image)
load_demo(ui.audio)
load_demo(ui.video)
load_demo(ui.icon)
load_demo(ui.avatar)
@text_demo('SVG',
'You can add Scalable Vector Graphics using the `ui.html` element.')
def svg_demo():
content = '''
'''
ui.html(content)