Skip to content

Commit e7955c0

Browse files
authored
Merge pull request #78 from AnswerDotAI/toast-app
add toast app
2 parents 439fdf4 + e41a6c1 commit e7955c0

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,5 @@ cython_debug/
168168
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
169169
# and can be added to the global gitignore or merged into this file. For a more nuclear
170170
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
171-
#.idea/
171+
.idea/
172172
.python-version
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from fasthtml.common import *
2+
from monsterui.all import *
3+
4+
app, rt = fast_app(hdrs=Theme.blue.headers())
5+
6+
@rt
7+
def index():
8+
return Div(cls="flex items-center justify-center h-screen")(
9+
Button("Show Toast", cls="bg-blue-500 text-white", hx_get="toast", hx_target="body", hx_swap="afterbegin")
10+
)
11+
12+
@rt
13+
def toast(): return Toast("Here's your toast 🍞!", dur=2, cls=[ToastVT.top, ToastHT.center], alert_cls="text-white bg-green-500 border-green-500")
Loading
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[REQUIRED]
2+
ImageAltText=Toast
3+
ComponentName=Toast
4+
ComponentDescription=A component that renders a toast on click

0 commit comments

Comments
 (0)