Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Oct 24, 2024
1 parent cd85e50 commit 48100a4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions website/documentation/content/section_text_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,19 @@
doc.intro(restructured_text_documentation)
doc.intro(mermaid_documentation)
doc.intro(html_documentation)


@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.
''')
def other_html_elements():
from nicegui import html, ui

with html.section().style('font-size: 120%'):
html.strong('This is bold.') \
.classes('cursor-pointer') \
.on('click', lambda: ui.notify('Bold!'))
html.hr()
html.em('This is italic.').tooltip('Nice!')

0 comments on commit 48100a4

Please sign in to comment.