From 48100a4ec31715c33e500fe47b75e247cb2be839 Mon Sep 17 00:00:00 2001 From: Falko Schindler Date: Thu, 24 Oct 2024 18:19:11 +0200 Subject: [PATCH] add documentation --- .../content/section_text_elements.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/website/documentation/content/section_text_elements.py b/website/documentation/content/section_text_elements.py index 1b50ca02e..b0f553774 100644 --- a/website/documentation/content/section_text_elements.py +++ b/website/documentation/content/section_text_elements.py @@ -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 ``, `
`, `

`, 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!')