33import reflex as rx
44
55import reflex_ui as ui
6+ from reflex_ui .blocks .demo_form import demo_form , demo_form_dialog
67
78
89class State (rx .State ):
@@ -15,46 +16,7 @@ def set_seed(self, seed: int):
1516
1617def index () -> rx .Component :
1718 return rx .el .div (
18- rx .el .div (
19- ui .tooltip (
20- ui .button (
21- ui .icon ("SmileIcon" ),
22- "Click me" ,
23- on_click = rx .toast .success (
24- "You are cool :)" ,
25- position = "top-center" ,
26- ),
27- ),
28- content = "Seriously, click me" ,
29- ),
30- ui .checkbox (
31- label = "Click me" ,
32- on_checked_change = lambda value : rx .toast .success (f"Value: { value } " ),
33- ),
34- ui .slider (
35- value = State .seed ,
36- on_value_change = State .set_seed ,
37- on_value_committed = lambda value : rx .toast .success (f"Value: { value } " ),
38- class_name = "max-w-xs" ,
39- ),
40- ui .gradient_profile (
41- seed = State .seed ,
42- class_name = "size-10" ,
43- ),
44- ui .switch (
45- on_checked_change = lambda value : rx .toast .success (f"Value: { value } " ),
46- ),
47- ui .select (
48- items = [f"Item { i } " for i in range (1 , 11 )],
49- name = "select" ,
50- default_value = "Select an item" ,
51- on_value_change = lambda value : rx .toast .success (f"Value: { value } " ),
52- on_open_change = lambda value : rx .toast .success (f"Open: { value } " ),
53- ),
54- class_name = "flex flex-col gap-y-6 justify-center items-center" ,
55- ),
56- ui .theme_switcher (class_name = "absolute top-4 right-4" ),
57- class_name = "flex flex-row gap-16 justify-center items-center h-screen bg-secondary-1 relative" ,
19+ demo_form (),
5820 )
5921
6022
@@ -78,6 +40,9 @@ def index() -> rx.Component:
7840 href = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400..700&display=swap" ,
7941 rel = "stylesheet" ,
8042 ),
43+ rx .el .script (
44+ """!function(e,t){var _=0;e.__default__=e.__default__||{},e.__default__.form_id=268792,e.__default__.team_id=654,e.__default__.listenToIds=[],function e(){var o=t.createElement("script");o.async=!0,o.src="https://import-cdn.default.com",o.onload=function(){!0,console.info("[Default.com] Powered by Default.com")},o.onerror=function(){++_<=3&&setTimeout(e,1e3*_)},t.head.appendChild(o)}()}(window,document);"""
45+ ),
8146 ],
8247)
8348app .add_page (index )
0 commit comments