Spaces:
Sleeping
Sleeping
| from fasthtml.common import * | |
| from monsterui.all import * | |
| import time | |
| from fasthtml.components import Uk_theme_switcher | |
| app, rt = fast_app(hdrs=Theme.blue.headers()) | |
| def index(): | |
| return Titled("Loading Demo", | |
| Button("Load", id='load', | |
| hx_get=load, hx_target='#content', hx_swap='beforeend', | |
| hx_indicator='#loading'), | |
| Div(id='content'), | |
| Loading(id='loading', htmx_indicator=True)) | |
| def load(): | |
| time.sleep(1) | |
| return P("Loading Demo") | |
| def theme(): return Uk_theme_switcher() | |
| serve() | |