some minor tweaks

This commit is contained in:
2022-09-13 19:18:24 +02:00
parent c0bb89c752
commit 01eec041b5
6 changed files with 72 additions and 9 deletions

View File

@ -5,17 +5,25 @@ 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 = bHTML.Div("This is a sidebar", parent=app.sidebar)
div.font_size = 4
btn = bHTML.ButtonPrimary("Click me", parent=app.sidebar)
btn.w = 100
toast_container = bHTML.ToastContainer(parent=app.main_area)
toast_container.position_bottom = 0
toast_container.position_end = 0
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
alert.w = 25
toast = bHTML.Toast("You clicked me!", parent=toast_container)
toast.animation = True
toast.show()
btn.onclick = onclick