Skip to content

Commit

Permalink
provide info and demo on how to set props
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Oct 25, 2024
1 parent a996c0a commit 4e07df2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions website/documentation/content/section_text_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
@doc.demo('Other HTML Elements', '''
There is an `html` module that allows you to insert other HTML elements like `<span>`, `<div>`, `<p>`, etc.
It is equivalent to using the `ui.element` method with the `tag` argument.
Like any other element, you can add classes, style, props, tooltips and events.
One convenience is that the kwargs are automatically added to the element's `props` dictionary.
''')
def other_html_elements():
from nicegui import html, ui
Expand All @@ -36,3 +38,6 @@ def other_html_elements():
.on('click', lambda: ui.notify('Bold!'))
html.hr()
html.em('This is italic.').tooltip('Nice!')
with ui.row():
html.img().props('src=https://placehold.co/60')
html.img(src='https://placehold.co/60')

0 comments on commit 4e07df2

Please sign in to comment.