pyscript-bootstrap-templates/examples/01_hello_world/main.py

22 lines
713 B
Python
Raw Normal View History

2022-09-11 16:33:43 +02:00
from pyscript_bootstrap_templates import bootstrap_templates
from pyscript_bootstrap_templates import bootstrap_HTML as bHTML
from pyscript_bootstrap_templates import HTML as HTML
app = bootstrap_templates.PyScriptBootstrapDashboard(
parent_element="pyscript_app", brand_name="hello_world")
div = bHTML.BootstrapContainer("This is a sidebar", parent=app.sidebar)
div.font_size = 4
btn = bHTML.ButtonPrimary("Click me", parent=app.sidebar)
btn.w = 100
2022-09-13 16:51:43 +02:00
def onclick(_):
alert = bHTML.AlertSuccess("You clicked me!", parent=app.main_area)
toast = bHTML.Toast("You clicked me!", parent=app.main_area)
toast.position_bottom = 0
toast.position_end = 0
toast.show()
btn.onclick = onclick
2022-09-11 16:33:43 +02:00