instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
import reflex_ui as ui
class State(rx.State):
seed: int = 0
@rx.event
def set_seed(self, seed: int):
self.seed = seed
def index() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.tooltip(
ui.button(
ui.icon("SmileIcon"),
... | import reflex as rx |
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
import reflex as rx
|
class State(rx.State):
seed: int = 0
@rx.event
def set_seed(self, seed: int):
self.seed = seed
def index() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.tooltip(
ui.button(
ui.icon("SmileIcon"),
"Click me",
... | import reflex_ui as ui |
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
import reflex as rx
import reflex_ui as ui
|
def index() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.tooltip(
ui.button(
ui.icon("SmileIcon"),
"Click me",
on_click=rx.toast.success(
"You are cool :)",
position... | class State(rx.State):
seed: int = 0
@rx.event
def set_seed(self, seed: int):
self.seed = seed |
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
import reflex as rx
import reflex_ui as ui
class State(rx.State):
seed: int = 0
@rx.event
|
def index() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.tooltip(
ui.button(
ui.icon("SmileIcon"),
"Click me",
on_click=rx.toast.success(
"You are cool :)",
position... | def set_seed(self, seed: int):
self.seed = seed |
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
import reflex as rx
import reflex_ui as ui
class State(rx.State):
seed: int = 0
@rx.event
def set_seed(self, seed: int):
|
def index() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.tooltip(
ui.button(
ui.icon("SmileIcon"),
"Click me",
on_click=rx.toast.success(
"You are cool :)",
position... | self.seed = seed |
"""Reflex UI package."""
|
_REFLEX_UI_MAPPING = {
"components.base.accordion": ["accordion"],
"components.base.avatar": ["avatar"],
"components.base.badge": ["badge"],
"components.base.button": ["button"],
"components.base.card": ["card"],
"components.base.checkbox": ["checkbox"],
"components.base.collapsible": ["co... | from reflex.utils import lazy_loader |
["collapsible"],
"components.base.context_menu": ["context_menu"],
"components.base.dialog": ["dialog"],
"components.base.drawer": ["drawer"],
"components.base.gradient_profile": ["gradient_profile"],
"components.base.input": ["input"],
"components.base.link": ["link"],
"components.base.menu... |
_SUBMOD_ATTRS = {
**_REFLEX_UI_MAPPING,
"components": ["base"],
"components.icons.hugeicon": ["hi", "icon"],
"components.icons.simple_icon": ["simple_icon"],
"components.icons.others": ["spinner"],
"utils.twmerge": ["cn"],
}
getattr, __dir__, __all__ = lazy_loader.attach(
__name__,
sub... | _SUBMODULES = {"components", "utils"} |
ink"],
"components.base.menu": ["menu"],
"components.base.navigation_menu": ["navigation_menu"],
"components.base.popover": ["popover"],
"components.base.preview_card": ["preview_card"],
"components.base.scroll_area": ["scroll_area"],
"components.base.select": ["select"],
"components.base.sk... |
def __getattr__(name: str):
return getattr(name)
| getattr, __dir__, __all__ = lazy_loader.attach(
__name__,
submodules=_SUBMODULES,
submod_attrs=_SUBMOD_ATTRS,
) |
popover": ["popover"],
"components.base.preview_card": ["preview_card"],
"components.base.scroll_area": ["scroll_area"],
"components.base.select": ["select"],
"components.base.skeleton": ["skeleton"],
"components.base.slider": ["slider"],
"components.base.switch": ["switch"],
"components.bas... | def __getattr__(name: str):
return getattr(name) | |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
|
import os
import urllib.parse
import uuid
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_mes... | import asyncio |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
|
import uuid
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("... | import urllib.parse |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_er... | import uuid |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_for... | from collections.abc import Sequence |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo... | from dataclasses import asdict, dataclass |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONR... | from typing import Any |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATIO... | import httpx |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATION_ID = os.getenv("CO... | import reflex as rx |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
COMMONROOM_API_TOKEN = os.gete... | from reflex.experimental.client_state import ClientStateVar |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_RE... | from reflex.utils.console import log |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_REQUEST_DEMO_URL = os.gete... | import reflex_ui as ui |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_REQUEST_DEMO_URL = os.getenv(
"CAL_REQUEST_DEMO_URL", "https://app.lemcal.com/@jhtevis/30-minutes?back... | demo_form_error_message = ClientStateVar.create("demo_form_error_message", "") |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_REQUEST_DEMO_URL = os.getenv(
"CAL_REQUEST_DEMO_URL", "https://app.lemcal.com/@jhtevis/30-minutes?back=1"
)
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
"CAL_ENTERPRISE_FOLLOW_U... | is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False) |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_REQUEST_DEMO_URL = os.getenv(
"CAL_REQUEST_DEMO_URL", "https://app.lemcal.com/@jhtevis/30-minutes?back=1"
)
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
"CAL_ENTERPRISE_FOLLOW_UP_URL",
"https://app.lemcal.com/@alek/reflex-demo?back=1",
)
SLACK_D... | COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "") |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
CAL_REQUEST_DEMO_URL = os.getenv(
"CAL_REQUEST_DEMO_URL", "https://app.lemcal.com/@jhtevis/30-minutes?back=1"
)
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
"CAL_ENTERPRISE_FOLLOW_UP_URL",
"https://app.lemcal.com/@alek/reflex-demo?back=1",
)
SLACK_DEMO_WEBHOOK_URL = os.getenv("SLACK_DEMO_WEBHOOK_URL", "")
POS... | COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "") |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
"CAL_ENTERPRISE_FOLLOW_UP_URL",
"https://app.lemcal.com/@alek/reflex-demo?back=1",
)
SLACK_DEMO_WEBHOOK_URL = os.getenv("SLACK_DEMO_WEBHOOK_URL", "")
POSTHOG_API_KEY = os.getenv("POSTHOG_API_KEY", "")
@dataclass(kw_only=True)
class PosthogEvent:
"""Base event str... | CAL_REQUEST_DEMO_URL = os.getenv(
"CAL_REQUEST_DEMO_URL", "https://app.lemcal.com/@jhtevis/30-minutes?back=1"
) |
"""Demo form component for collecting user information and scheduling enterprise calls.
This module provides a comprehensive demo form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.pars... |
SLACK_DEMO_WEBHOOK_URL = os.getenv("SLACK_DEMO_WEBHOOK_URL", "")
POSTHOG_API_KEY = os.getenv("POSTHOG_API_KEY", "")
@dataclass(kw_only=True)
class PosthogEvent:
"""Base event structure."""
distinct_id: str
def to_dict(self) -> dict[str, Any]:
"""Convert the event instance to a dictionary repres... | CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
"CAL_ENTERPRISE_FOLLOW_UP_URL",
"https://app.lemcal.com/@alek/reflex-demo?back=1",
) |
form that validates company emails,
sends data to PostHog and Slack, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.parse
import uuid
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
i... |
POSTHOG_API_KEY = os.getenv("POSTHOG_API_KEY", "")
@dataclass(kw_only=True)
class PosthogEvent:
"""Base event structure."""
distinct_id: str
def to_dict(self) -> dict[str, Any]:
"""Convert the event instance to a dictionary representation.
Returns:
A dictionary containing a... | SLACK_DEMO_WEBHOOK_URL = os.getenv("SLACK_DEMO_WEBHOOK_URL", "") |
ck, and redirects users to appropriate Cal.com links
based on company size.
"""
import asyncio
import os
import urllib.parse
import uuid
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import C... |
@dataclass(kw_only=True)
class PosthogEvent:
"""Base event structure."""
distinct_id: str
def to_dict(self) -> dict[str, Any]:
"""Convert the event instance to a dictionary representation.
Returns:
A dictionary containing all the event data.
"""
return asdic... | POSTHOG_API_KEY = os.getenv("POSTHOG_API_KEY", "") |
"
import asyncio
import os
import urllib.parse
import uuid
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
de... |
@dataclass
class DemoEvent(PosthogEvent):
"""Event for demo booking."""
first_name: str
last_name: str
company_email: str
job_title: str
company_name: str
num_employees: str
internal_tools: str
referral_source: str
def input_field(
label: str,
placeholder: str,
name... | class PosthogEvent:
"""Base event structure."""
distinct_id: str
def to_dict(self) -> dict[str, Any]:
"""Convert the event instance to a dictionary representation.
Returns:
A dictionary containing all the event data.
"""
return asdict(self) |
c import Sequence
from dataclasses import asdict, dataclass
from typing import Any
import httpx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.console import log
import reflex_ui as ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is... |
@dataclass
class DemoEvent(PosthogEvent):
"""Event for demo booking."""
first_name: str
last_name: str
company_email: str
job_title: str
company_name: str
num_employees: str
internal_tools: str
referral_source: str
def input_field(
label: str,
placeholder: str,
name... | def to_dict(self) -> dict[str, Any]:
"""Convert the event instance to a dictionary representation.
Returns:
A dictionary containing all the event data.
"""
return asdict(self) |
ui
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_REQUEST_DEMO_URL = os.g... |
def input_field(
label: str,
placeholder: str,
name: str,
type: str = "text",
required: bool = False,
) -> rx.Component:
"""Create a labeled input field component.
Args:
label: The label text to display above the input
placeholder: Placeholder text for the input
n... | class DemoEvent(PosthogEvent):
"""Event for demo booking."""
first_name: str
last_name: str
company_email: str
job_title: str
company_name: str
num_employees: str
internal_tools: str
referral_source: str |
API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
CAL_REQUEST_DEMO_URL = os.getenv(
"CAL_REQUEST_DEMO_URL", "https://app.lemcal.com/@jhtevis/30-minutes?back=1"
)
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
"CAL_ENTERPRISE_FOLLOW_UP_URL",
"https://app.lemcal.com/@alek/reflex-demo?back=1",
)
SLACK_DEMO_WEBHOOK_... |
def text_area_field(
label: str, placeholder: str, name: str, required: bool = False
) -> rx.Component:
"""Create a labeled textarea field component.
Args:
label: The label text to display above the textarea
placeholder: Placeholder text for the textarea
name: The name attribute ... | def input_field(
label: str,
placeholder: str,
name: str,
type: str = "text",
required: bool = False,
) -> rx.Component:
"""Create a labeled input field component.
Args:
label: The label text to display above the input
placeholder: Placeholder text for the input
name... |
referral_source: str
def input_field(
label: str,
placeholder: str,
name: str,
type: str = "text",
required: bool = False,
) -> rx.Component:
"""Create a labeled input field component.
Args:
label: The label text to display above the input
placeholder: Placeholder text f... |
def select_field(
label: str,
name: str,
items: list[str],
required: bool = False,
) -> rx.Component:
"""Create a labeled select field component.
Args:
label: The label text to display above the select
name: The name attribute for the select field
items: List of optio... | def text_area_field(
label: str, placeholder: str, name: str, required: bool = False
) -> rx.Component:
"""Create a labeled textarea field component.
Args:
label: The label text to display above the textarea
placeholder: Placeholder text for the textarea
name: The name attribute for... |
e,
type=type,
required=required,
max_length=255,
class_name="w-full",
),
class_name="flex flex-col gap-1.5",
)
def text_area_field(
label: str, placeholder: str, name: str, required: bool = False
) -> rx.Component:
"""Create a labeled textare... |
def is_small_company(num_employees: str) -> bool:
"""Check if company has 10 or fewer employees."""
return num_employees in ["1", "2-5", "6-10"]
def check_if_company_email(email: str) -> bool:
"""Check if an email address is from a company domain (not a personal email provider).
Args:
emai... | def select_field(
label: str,
name: str,
items: list[str],
required: bool = False,
) -> rx.Component:
"""Create a labeled select field component.
Args:
label: The label text to display above the select
name: The name attribute for the select field
items: List of options ... |
class_name="w-full",
max_length=800,
),
class_name="flex flex-col gap-1.5",
)
def select_field(
label: str,
name: str,
items: list[str],
required: bool = False,
) -> rx.Component:
"""Create a labeled select field component.
Args:
label: The labe... |
def check_if_company_email(email: str) -> bool:
"""Check if an email address is from a company domain (not a personal email provider).
Args:
email: The email address to check
Returns:
True if it's likely a company email, False if it's from a personal provider
"""
if not email or... | def is_small_company(num_employees: str) -> bool:
"""Check if company has 10 or fewer employees."""
return num_employees in ["1", "2-5", "6-10"] |
name: str,
items: list[str],
required: bool = False,
) -> rx.Component:
"""Create a labeled select field component.
Args:
label: The label text to display above the select
name: The name attribute for the select field
items: List of options to display in the select
re... |
def check_if_number_of_employees_is_valid(number_of_employees: str) -> bool:
"""Check if the number of employees is valid."""
return number_of_employees.strip() != "Select"
def check_if_referral_source_is_valid(referral_source: str) -> bool:
"""Check if the referral source is valid."""
return refer... | def check_if_company_email(email: str) -> bool:
"""Check if an email address is from a company domain (not a personal email provider).
Args:
email: The email address to check
Returns:
True if it's likely a company email, False if it's from a personal provider
"""
if not email or "@... |
select
required: Whether the field is required
Returns:
A Reflex component containing the labeled select field
"""
return rx.el.div(
rx.el.label(
label + (" *" if required else ""),
class_name="block text-sm font-medium text-secondary-12",
),
... |
domain = email.split("@")[-1].lower()
# List of common personal email providers
personal_domains = {
"gmail.com",
"outlook.com",
"hotmail.com",
"yahoo.com",
"icloud.com",
"aol.com",
"protonmail.com",
"proton.me",
"mail.com",
... | if not email or "@" not in email:
return False |
Returns:
A Reflex component containing the labeled select field
"""
return rx.el.div(
rx.el.label(
label + (" *" if required else ""),
class_name="block text-sm font-medium text-secondary-12",
),
ui.select(
default_value="Select",
... |
# List of common personal email providers
personal_domains = {
"gmail.com",
"outlook.com",
"hotmail.com",
"yahoo.com",
"icloud.com",
"aol.com",
"protonmail.com",
"proton.me",
"mail.com",
"yandex.com",
"zoho.com",
"... | domain = email.split("@")[-1].lower() |
rn rx.el.div(
rx.el.label(
label + (" *" if required else ""),
class_name="block text-sm font-medium text-secondary-12",
),
ui.select(
default_value="Select",
name=name,
items=items,
required=required,
class_name... |
return domain not in personal_domains and ".edu" not in domain
def check_if_number_of_employees_is_valid(number_of_employees: str) -> bool:
"""Check if the number of employees is valid."""
return number_of_employees.strip() != "Select"
def check_if_referral_source_is_valid(referral_source: str) -> boo... | personal_domains = {
"gmail.com",
"outlook.com",
"hotmail.com",
"yahoo.com",
"icloud.com",
"aol.com",
"protonmail.com",
"proton.me",
"mail.com",
"yandex.com",
"zoho.com",
"live.com",
"msn.com",
"me.com",
... |
check_if_company_email(email: str) -> bool:
"""Check if an email address is from a company domain (not a personal email provider).
Args:
email: The email address to check
Returns:
True if it's likely a company email, False if it's from a personal provider
"""
if not email or "@" no... |
def check_if_referral_source_is_valid(referral_source: str) -> bool:
"""Check if the referral source is valid."""
return referral_source.strip() != "Select"
class DemoForm(rx.ComponentState):
"""Component state for handling demo form submissions and integrations."""
@rx.event(background=True)
... | def check_if_number_of_employees_is_valid(number_of_employees: str) -> bool:
"""Check if the number of employees is valid."""
return number_of_employees.strip() != "Select" |
heck
Returns:
True if it's likely a company email, False if it's from a personal provider
"""
if not email or "@" not in email:
return False
domain = email.split("@")[-1].lower()
# List of common personal email providers
personal_domains = {
"gmail.com",
"outlo... |
class DemoForm(rx.ComponentState):
"""Component state for handling demo form submissions and integrations."""
@rx.event(background=True)
async def on_submit(self, form_data: dict[str, Any]):
"""Handle form submission with validation and routing logic.
Validates company email, sends data... | def check_if_referral_source_is_valid(referral_source: str) -> bool:
"""Check if the referral source is valid."""
return referral_source.strip() != "Select" |
co.in",
"outlook.co.uk",
"hotmail.co.uk",
}
return domain not in personal_domains and ".edu" not in domain
def check_if_number_of_employees_is_valid(number_of_employees: str) -> bool:
"""Check if the number of employees is valid."""
return number_of_employees.strip() != "Select"
def... |
# Check if the has selected a number of employees
if not check_if_number_of_employees_is_valid(
form_data.get("number_of_employees", "")
):
yield rx.toast.error(
"Please select a number of employees",
position="top-center",
)
... | if not check_if_company_email(form_data.get("email", "")):
yield rx.set_focus("email")
yield rx.toast.error(
"Please enter a valid company email",
position="top-center",
)
yield demo_form_error_message.push("Please enter a valid company ema... |
rral source is valid."""
return referral_source.strip() != "Select"
class DemoForm(rx.ComponentState):
"""Component state for handling demo form submissions and integrations."""
@rx.event(background=True)
async def on_submit(self, form_data: dict[str, Any]):
"""Handle form submission with val... |
# Check if the has entered a referral source
if not check_if_referral_source_is_valid(
form_data.get("how_did_you_hear_about_us", "")
):
yield rx.toast.error(
"Please select how did you hear about us",
position="top-center",
)... | if not check_if_number_of_employees_is_valid(
form_data.get("number_of_employees", "")
):
yield rx.toast.error(
"Please select a number of employees",
position="top-center",
)
yield demo_form_error_message.push("Please select a numb... |
then redirects to appropriate Cal.com link based on company size.
Args:
form_data: Form data dictionary containing user inputs
"""
if not check_if_company_email(form_data.get("email", "")):
yield rx.set_focus("email")
yield rx.toast.error(
... |
yield is_sending_demo_form.push(True)
# Send to PostHog and Slack for all submissions
await self.send_demo_event(form_data)
yield rx.call_script(
f"try {{ ko.identify('{form_data.get('email', '')}'); }} catch(e) {{ console.warn('Koala identify failed:', e); }}"
)
... | if not check_if_referral_source_is_valid(
form_data.get("how_did_you_hear_about_us", "")
):
yield rx.toast.error(
"Please select how did you hear about us",
position="top-center",
)
yield demo_form_error_message.push(
... |
r(
"Please select a number of employees",
position="top-center",
)
yield demo_form_error_message.push("Please select a number of employees")
return
# Check if the has entered a referral source
if not check_if_referral_source_is_valid(
... |
params = {
"email": form_data.get("email", ""),
"name": f"{form_data.get('first_name', '')} {form_data.get('last_name', '')}",
"notes": notes_content,
}
query_string = urllib.parse.urlencode(params)
if is_small_company(form_data.get("number_of_employ... | notes_content = f"""
Name: {form_data.get("first_name", "")} {form_data.get("last_name", "")}
Business Email: {form_data.get("email", "")}
Job Title: {form_data.get("job_title", "")}
Company Name: {form_data.get("company_name", "")}
Number of Employees: {form_data.get("number_of_employees", "")}
Internal Tools to Build... |
elect how did you hear about us",
position="top-center",
)
yield demo_form_error_message.push(
"Please select how did you hear about us"
)
return
yield is_sending_demo_form.push(True)
# Send to PostHog and Slack for all subm... |
query_string = urllib.parse.urlencode(params)
if is_small_company(form_data.get("number_of_employees", "")):
yield rx.redirect(f"{CAL_REQUEST_DEMO_URL}?{query_string}")
return
cal_url_with_params = f"{CAL_ENTERPRISE_FOLLOW_UP_URL}?{query_string}"
yield is_send... | params = {
"email": form_data.get("email", ""),
"name": f"{form_data.get('first_name', '')} {form_data.get('last_name', '')}",
"notes": notes_content,
} |
return
yield is_sending_demo_form.push(True)
# Send to PostHog and Slack for all submissions
await self.send_demo_event(form_data)
yield rx.call_script(
f"try {{ ko.identify('{form_data.get('email', '')}'); }} catch(e) {{ console.warn('Koala identify failed:', e... |
if is_small_company(form_data.get("number_of_employees", "")):
yield rx.redirect(f"{CAL_REQUEST_DEMO_URL}?{query_string}")
return
cal_url_with_params = f"{CAL_ENTERPRISE_FOLLOW_UP_URL}?{query_string}"
yield is_sending_demo_form.push(False)
yield rx.redirect(cal... | query_string = urllib.parse.urlencode(params) |
.push(True)
# Send to PostHog and Slack for all submissions
await self.send_demo_event(form_data)
yield rx.call_script(
f"try {{ ko.identify('{form_data.get('email', '')}'); }} catch(e) {{ console.warn('Koala identify failed:', e); }}"
)
notes_content = f"""
Name: {f... |
cal_url_with_params = f"{CAL_ENTERPRISE_FOLLOW_UP_URL}?{query_string}"
yield is_sending_demo_form.push(False)
yield rx.redirect(cal_url_with_params)
async def send_demo_event(self, form_data: dict[str, Any]):
"""Create and send demo event to PostHog and Slack.
Converts f... | if is_small_company(form_data.get("number_of_employees", "")):
yield rx.redirect(f"{CAL_REQUEST_DEMO_URL}?{query_string}")
return |
{{ ko.identify('{form_data.get('email', '')}'); }} catch(e) {{ console.warn('Koala identify failed:', e); }}"
)
notes_content = f"""
Name: {form_data.get("first_name", "")} {form_data.get("last_name", "")}
Business Email: {form_data.get("email", "")}
Job Title: {form_data.get("job_title", "")}
Company N... |
yield is_sending_demo_form.push(False)
yield rx.redirect(cal_url_with_params)
async def send_demo_event(self, form_data: dict[str, Any]):
"""Create and send demo event to PostHog and Slack.
Converts form data into a DemoEvent and sends to both analytics
platforms. Logs er... | cal_url_with_params = f"{CAL_ENTERPRISE_FOLLOW_UP_URL}?{query_string}" |
.get("how_did_you_hear_about_us", "")}"""
params = {
"email": form_data.get("email", ""),
"name": f"{form_data.get('first_name', '')} {form_data.get('last_name', '')}",
"notes": notes_content,
}
query_string = urllib.parse.urlencode(params)
if is_smal... |
last_name = form_data.get("last_name", "")
demo_event = DemoEvent(
distinct_id=f"{first_name} {last_name}",
first_name=first_name,
last_name=last_name,
company_email=form_data.get("email", ""),
job_title=form_data.get("job_title", ""),
... | first_name = form_data.get("first_name", "") |
ams = {
"email": form_data.get("email", ""),
"name": f"{form_data.get('first_name', '')} {form_data.get('last_name', '')}",
"notes": notes_content,
}
query_string = urllib.parse.urlencode(params)
if is_small_company(form_data.get("number_of_employees", "")):
... |
demo_event = DemoEvent(
distinct_id=f"{first_name} {last_name}",
first_name=first_name,
last_name=last_name,
company_email=form_data.get("email", ""),
job_title=form_data.get("job_title", ""),
company_name=form_data.get("company_name", "")... | last_name = form_data.get("last_name", "") |
""),
"name": f"{form_data.get('first_name', '')} {form_data.get('last_name', '')}",
"notes": notes_content,
}
query_string = urllib.parse.urlencode(params)
if is_small_company(form_data.get("number_of_employees", "")):
yield rx.redirect(f"{CAL_REQUEST_DEMO_U... |
# Send data to PostHog, Common Room, and Slack
await asyncio.gather(
self.send_data_to_posthog(demo_event),
self.send_data_to_common_room(demo_event),
self.send_data_to_slack(demo_event),
)
async def send_data_to_posthog(self, event_instance: PosthogEve... | demo_event = DemoEvent(
distinct_id=f"{first_name} {last_name}",
first_name=first_name,
last_name=last_name,
company_email=form_data.get("email", ""),
job_title=form_data.get("job_title", ""),
company_name=form_data.get("company_name", ""),
... |
last_name=last_name,
company_email=form_data.get("email", ""),
job_title=form_data.get("job_title", ""),
company_name=form_data.get("company_name", ""),
num_employees=form_data.get("number_of_employees", ""),
internal_tools=form_data.get("internal... |
try:
async with httpx.AsyncClient() as client:
response = await client.post(
"https://app.posthog.com/capture/", json=event_data
)
response.raise_for_status()
except Exception:
log("Error sending data to PostHog... | event_data = {
"api_key": POSTHOG_API_KEY,
"event": event_instance.__class__.__name__,
"properties": event_instance.to_dict(),
} |
loyees", ""),
internal_tools=form_data.get("internal_tools", ""),
referral_source=form_data.get("how_did_you_hear_about_us", ""),
)
# Send data to PostHog, Common Room, and Slack
await asyncio.gather(
self.send_data_to_posthog(demo_event),
self.se... |
response.raise_for_status()
except Exception:
log("Error sending data to PostHog")
async def send_data_to_common_room(self, event_instance: DemoEvent):
"""Update CommonRoom with user login information."""
tags: Sequence[str] = [
"Requested Demo",
... | response = await client.post(
"https://app.posthog.com/capture/", json=event_data
) |
json={
"id": "requested_demo",
"activityType": "requested_demo",
"user": {
"id": str(uuid.uuid4()),
"email": event_instance.company_email,
},
... |
try:
async with httpx.AsyncClient() as client:
response = await client.post(
SLACK_DEMO_WEBHOOK_URL,
json=slack_payload,
headers={"Content-Type": "application/json"},
)
response.raise_for_sta... | slack_payload = {
"lookingToBuild": event_instance.internal_tools,
"businessEmail": event_instance.company_email,
"howDidYouHear": event_instance.referral_source,
"jobTitle": event_instance.job_title,
"numEmployees": event_instance.num_employees,
"... |
],
},
)
except Exception as ex:
log(
f"CommonRoom: Failed to identify user with email {event_instance.company_email}, err: {ex}"
)
async def send_data_to_slack(self, event_instance: DemoEvent):
"""Send demo form data ... |
response.raise_for_status()
except Exception as e:
log(f"Error sending data to Slack webhook: {e}")
@classmethod
def get_component(cls, **props):
"""Create and return the demo form component.
Builds a complete form with all required fields, validation,
... | response = await client.post(
SLACK_DEMO_WEBHOOK_URL,
json=slack_payload,
headers={"Content-Type": "application/json"},
) |
"Google Search",
"Social Media",
"Word of Mouth",
"Blog",
"Conference",
"Other",
],
),
class_name="grid @max-md:grid-cols-1 grid-col... | demo_form = DemoForm.create | |
"""Lemcal calendar embed components."""
|
import reflex_ui as ui
LEMCAL_DEMO_URL = "https://app.lemcal.com/@alek/reflex-demo-call"
@rx.memo
def lemcal_booking_calendar():
"""Return the Lemcal booking calendar."""
return rx.fragment(
rx.el.div(
class_name="lemcal-embed-booking-calendar h-[calc(100dvh-4rem)] overflow-y-auto w-aut... | import reflex as rx |
"""Lemcal calendar embed components."""
import reflex as rx
|
LEMCAL_DEMO_URL = "https://app.lemcal.com/@alek/reflex-demo-call"
@rx.memo
def lemcal_booking_calendar():
"""Return the Lemcal booking calendar."""
return rx.fragment(
rx.el.div(
class_name="lemcal-embed-booking-calendar h-[calc(100dvh-4rem)] overflow-y-auto w-auto max-h-fit",
... | import reflex_ui as ui |
"""Lemcal calendar embed components."""
import reflex as rx
import reflex_ui as ui
|
@rx.memo
def lemcal_booking_calendar():
"""Return the Lemcal booking calendar."""
return rx.fragment(
rx.el.div(
class_name="lemcal-embed-booking-calendar h-[calc(100dvh-4rem)] overflow-y-auto w-auto max-h-fit",
custom_attrs={
"data-user": "usr_8tiwtJ8nEJaFj2qH... | LEMCAL_DEMO_URL = "https://app.lemcal.com/@alek/reflex-demo-call" |
o
def lemcal_booking_calendar():
"""Return the Lemcal booking calendar."""
return rx.fragment(
rx.el.div(
class_name="lemcal-embed-booking-calendar h-[calc(100dvh-4rem)] overflow-y-auto w-auto max-h-fit",
custom_attrs={
"data-user": "usr_8tiwtJ8nEJaFj2qH9",
... |
return ui.dialog.root(
ui.dialog.trigger(render_=trigger),
ui.dialog.portal(
ui.dialog.backdrop(),
ui.dialog.popup(
rx.el.div(
ui.dialog.close(
render_=ui.button(
ui.hi("Cancel01Icon"),
... | class_name = ui.cn("w-auto", props.pop("class_name", "")) |
"""Clearbit analytics tracking integration for Reflex applications."""
|
CLEARBIT_SCRIPT_URL_TEMPLATE: str = (
"https://tag.clearbitscripts.com/v1/{public_key}/tags.js"
)
def get_clearbit_trackers(public_key: str) -> rx.Component:
"""Generate Clearbit tracking component for a Reflex application.
Args:
public_key: Clearbit public key (defaults to app's public key)
... | import reflex as rx |
"""Common Room website visitor tracking integration for Reflex applications."""
|
import reflex as rx
# Common Room tracking configuration
COMMON_ROOM_CDN_URL_TEMPLATE: str = (
"https://cdn.cr-relay.com/v1/site/{site_id}/signals.js"
)
# Common Room tracking script template
COMMON_ROOM_SCRIPT_TEMPLATE: str = """
(function() {{
if (typeof window === 'undefined') return;
if (typeof wind... | import json |
"""Common Room website visitor tracking integration for Reflex applications."""
import json
|
# Common Room tracking configuration
COMMON_ROOM_CDN_URL_TEMPLATE: str = (
"https://cdn.cr-relay.com/v1/site/{site_id}/signals.js"
)
# Common Room tracking script template
COMMON_ROOM_SCRIPT_TEMPLATE: str = """
(function() {{
if (typeof window === 'undefined') return;
if (typeof window.signals !== 'undef... | import reflex as rx |
{site_id}/signals.js"
)
# Common Room tracking script template
COMMON_ROOM_SCRIPT_TEMPLATE: str = """
(function() {{
if (typeof window === 'undefined') return;
if (typeof window.signals !== 'undefined') return;
var script = document.createElement('script');
script.src = '{cdn_url}';
script.async = ... |
return rx.script(COMMON_ROOM_SCRIPT_TEMPLATE.format(cdn_url=cdn_url))
def identify_common_room_user(
email: str, name: str | None = None
) -> rx.event.EventSpec:
"""Identify a user in Common Room analytics after form submission or login.
This should be called when you have user identity information... | cdn_url = COMMON_ROOM_CDN_URL_TEMPLATE.format(site_id=site_id) |
ument.head.appendChild(script);
}})();
"""
def get_common_room_trackers(site_id: str) -> rx.Component:
"""Generate Common Room tracking component for a Reflex application.
Args:
site_id: Your Common Room site ID (found in your tracking snippet)
Returns:
rx.Component: Script component nee... |
if name:
identify_data["name"] = name
js_data = json.dumps(identify_data)
return rx.call_script(
f"""
// Identify user in Common Room after form submission or login
if (typeof window.signals !== 'undefined' && window.signals.identify) {{
window.signals.identify... | identify_data = {"email": email} |
;
"""
def get_common_room_trackers(site_id: str) -> rx.Component:
"""Generate Common Room tracking component for a Reflex application.
Args:
site_id: Your Common Room site ID (found in your tracking snippet)
Returns:
rx.Component: Script component needed for Common Room tracking
"""
... |
js_data = json.dumps(identify_data)
return rx.call_script(
f"""
// Identify user in Common Room after form submission or login
if (typeof window.signals !== 'undefined' && window.signals.identify) {{
window.signals.identify({js_data});
}}
"""
)
| if name:
identify_data["name"] = name |
ommon_room_trackers(site_id: str) -> rx.Component:
"""Generate Common Room tracking component for a Reflex application.
Args:
site_id: Your Common Room site ID (found in your tracking snippet)
Returns:
rx.Component: Script component needed for Common Room tracking
"""
cdn_url = COM... |
js_data = json.dumps(identify_data)
return rx.call_script(
f"""
// Identify user in Common Room after form submission or login
if (typeof window.signals !== 'undefined' && window.signals.identify) {{
window.signals.identify({js_data});
}}
"""
)
| identify_data["name"] = name |
-> rx.Component:
"""Generate Common Room tracking component for a Reflex application.
Args:
site_id: Your Common Room site ID (found in your tracking snippet)
Returns:
rx.Component: Script component needed for Common Room tracking
"""
cdn_url = COMMON_ROOM_CDN_URL_TEMPLATE.format(s... |
return rx.call_script(
f"""
// Identify user in Common Room after form submission or login
if (typeof window.signals !== 'undefined' && window.signals.identify) {{
window.signals.identify({js_data});
}}
"""
)
| js_data = json.dumps(identify_data) |
"""Google Analytics tracking integration for Reflex applications."""
|
# Google Tag Manager script template
GTAG_SCRIPT_TEMPLATE: str = """
window.dataLayer = window.dataLayer || [];
function gtag() {{
window.dataLayer.push(arguments);
}}
gtag('js', new Date());
gtag('config', '{tracking_id}');
"""
# Google Tag Manager script URL template
GTAG_SCRIPT_URL_TEMPLATE: str = (
"http... | import reflex as rx |
"""Koala analytics tracking integration for Reflex applications."""
|
# Koala tracking configuration
KOALA_SCRIPT_URL_TEMPLATE: str = "https://cdn.getkoala.com/v1/{public_api_key}/sdk.js"
# Koala initialization script template
KOALA_SCRIPT_TEMPLATE: str = """
!function(t) {{
if (window.ko) return;
window.ko = [];
[
"identify",
"track",
"removeListen... | import reflex as rx |
acking configuration
KOALA_SCRIPT_URL_TEMPLATE: str = "https://cdn.getkoala.com/v1/{public_api_key}/sdk.js"
# Koala initialization script template
KOALA_SCRIPT_TEMPLATE: str = """
!function(t) {{
if (window.ko) return;
window.ko = [];
[
"identify",
"track",
"removeListeners",
... |
return rx.script(KOALA_SCRIPT_TEMPLATE.format(script_url=script_url))
| script_url = KOALA_SCRIPT_URL_TEMPLATE.format(public_api_key=public_api_key) |
"""PostHog analytics tracking integration for Reflex applications."""
|
import reflex as rx
# PostHog tracking configuration
POSTHOG_API_HOST: str = "https://us.i.posthog.com"
# PostHog initialization script template
POSTHOG_SCRIPT_TEMPLATE: str = """
!function(t,e){{
var o,n,p,r;
e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){{
function g(t,e){{
v... | import json |
"""PostHog analytics tracking integration for Reflex applications."""
import json
|
# PostHog tracking configuration
POSTHOG_API_HOST: str = "https://us.i.posthog.com"
# PostHog initialization script template
POSTHOG_SCRIPT_TEMPLATE: str = """
!function(t,e){{
var o,n,p,r;
e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){{
function g(t,e){{
var o=e.split(".");
... | import reflex as rx |
.people (stub)"
}},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment g... |
return rx.call_script(
f"""
if (typeof posthog !== 'undefined') {{
posthog.identify({user_id});
}}
"""
)
def get_posthog_trackers(
project_id: str,
api_host: str = POSTHOG_API_HOST,
) -> rx.Component:
"""Generate PostHog tracking component for a Reflex... | user_id = json.dumps(user_id) |
"""RB2B (Reveal Bot to Bot) analytics tracking integration for Reflex applications."""
|
PIXEL_SCRIPT_RB2B: str = """
!function () {var reb2b = window.reb2b = window.reb2b || [];if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);args.unshift(method);reb2b.push(args);... | import reflex as rx |
"""Telemetry blocks for the Reflex UI library."""
|
from .common_room import get_common_room_trackers, identify_common_room_user
from .google import get_google_analytics_trackers
from .koala import get_koala_trackers
from .posthog import get_posthog_trackers
from .rb2b import get_rb2b_trackers
__all__ = [
"get_clearbit_trackers",
"get_common_room_trackers",
... | from .clearbit import get_clearbit_trackers |
"""Telemetry blocks for the Reflex UI library."""
from .clearbit import get_clearbit_trackers
from .common_room import get_common_room_trackers, identify_common_room_user
|
from .koala import get_koala_trackers
from .posthog import get_posthog_trackers
from .rb2b import get_rb2b_trackers
__all__ = [
"get_clearbit_trackers",
"get_common_room_trackers",
"get_google_analytics_trackers",
"get_koala_trackers",
"get_posthog_trackers",
"get_rb2b_trackers",
"identify... | from .google import get_google_analytics_trackers |
"""Telemetry blocks for the Reflex UI library."""
from .clearbit import get_clearbit_trackers
from .common_room import get_common_room_trackers, identify_common_room_user
from .google import get_google_analytics_trackers
|
from .posthog import get_posthog_trackers
from .rb2b import get_rb2b_trackers
__all__ = [
"get_clearbit_trackers",
"get_common_room_trackers",
"get_google_analytics_trackers",
"get_koala_trackers",
"get_posthog_trackers",
"get_rb2b_trackers",
"identify_common_room_user",
]
| from .koala import get_koala_trackers |
"""Telemetry blocks for the Reflex UI library."""
from .clearbit import get_clearbit_trackers
from .common_room import get_common_room_trackers, identify_common_room_user
from .google import get_google_analytics_trackers
from .koala import get_koala_trackers
|
from .rb2b import get_rb2b_trackers
__all__ = [
"get_clearbit_trackers",
"get_common_room_trackers",
"get_google_analytics_trackers",
"get_koala_trackers",
"get_posthog_trackers",
"get_rb2b_trackers",
"identify_common_room_user",
]
| from .posthog import get_posthog_trackers |
"""Telemetry blocks for the Reflex UI library."""
from .clearbit import get_clearbit_trackers
from .common_room import get_common_room_trackers, identify_common_room_user
from .google import get_google_analytics_trackers
from .koala import get_koala_trackers
from .posthog import get_posthog_trackers
|
__all__ = [
"get_clearbit_trackers",
"get_common_room_trackers",
"get_google_analytics_trackers",
"get_koala_trackers",
"get_posthog_trackers",
"get_rb2b_trackers",
"identify_common_room_user",
]
| from .rb2b import get_rb2b_trackers |
"""Base UI component."""
# Based on https://base-ui.com/
from reflex_ui.components.component import CoreComponent
PACKAGE_NAME = "@base-ui-components/react"
|
class BaseUIComponent(CoreComponent):
"""Base UI component."""
lib_dependencies: list[str] = [f"{PACKAGE_NAME}@{PACKAGE_VERSION}"]
| PACKAGE_VERSION = "1.0.0-beta.4" |
"""Core component for all components."""
|
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
unstyled: Var[bool]
@classmethod
def set_class_name(
... | from typing import Any |
"""Core component for all components."""
from typing import Any
|
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
unstyled: Var[bool]
@classmethod
def set_class_name(
cls, default_class_name: str | Var[str], prop... | from reflex.components.component import Component |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
|
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
unstyled: Var[bool]
@classmethod
def set_class_name(
cls, default_class_name: str | Var[str], props: dict[str, Any]
) -> None:
... | from reflex.vars.base import Var |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
from reflex.vars.base import Var
|
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
unstyled: Var[bool]
@classmethod
def set_class_name(
cls, default_class_name: str | Var[str], props: dict[str, Any]
) -> None:
"""Set the class name in props, ... | from reflex_ui.utils.twmerge import cn |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
... |
props_class_name = props.get("class_name", "")
if props.pop("unstyled", False):
props["class_name"] = props_class_name
return
props["class_name"] = cn(default_class_name, props_class_name)
def _exclude_props(self) -> list[str]:
return [
*super... | if "render_" in props:
return |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
... |
if props.pop("unstyled", False):
props["class_name"] = props_class_name
return
props["class_name"] = cn(default_class_name, props_class_name)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"unstyled",
]
| props_class_name = props.get("class_name", "") |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
... |
props["class_name"] = cn(default_class_name, props_class_name)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"unstyled",
]
| if props.pop("unstyled", False):
props["class_name"] = props_class_name
return |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
... |
return
props["class_name"] = cn(default_class_name, props_class_name)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"unstyled",
]
| props["class_name"] = props_class_name |
"""Core component for all components."""
from typing import Any
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.utils.twmerge import cn
class CoreComponent(Component):
"""Core component for all components."""
# Whether the component should be unstyled
... |
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"unstyled",
]
| props["class_name"] = cn(default_class_name, props_class_name) |
"""Custom Accordion component."""
|
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex.vars.objec... | from typing import Any, Literal |
"""Custom Accordion component."""
from typing import Any, Literal
|
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex.vars.object import ObjectVar
from reflex_ui.components.base_ui import PACKAGE_NA... | from reflex.components.component import Component, ComponentNamespace |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
|
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex.vars.object import ObjectVar
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons... | from reflex.components.core.foreach import foreach |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
|
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex.vars.object import ObjectVar
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import icon
LiteralOrienta... | from reflex.components.el import Div |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex.vars.object import ObjectVar
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import icon
LiteralOrientation = Literal["horizontal", "vertical"]
ITEMS_TYPE = list[di... | from reflex.event import EventHandler, passthrough_event_spec |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars.base import Var
from reflex.vars.object import ObjectVar
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import icon
LiteralOrientation = Literal["horizontal", "vertical"]
ITEMS_TYPE = list[dict[str, str | Component]]
class ClassName... | from reflex.utils.imports import ImportVar |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import... |
from reflex.vars.object import ObjectVar
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import icon
LiteralOrientation = Literal["horizontal", "vertical"]
ITEMS_TYPE = list[dict[str, str | Component]]
class ClassNames:
"""Class names for accordi... | from reflex.vars.base import Var |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import... |
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import icon
LiteralOrientation = Literal["horizontal", "vertical"]
ITEMS_TYPE = list[dict[str, str | Component]]
class ClassNames:
"""Class names for accordion components."""
ROOT = "flex flex-... | from reflex.vars.object import ObjectVar |
"""Custom Accordion component."""
from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.components.el import Div
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import... |
from reflex_ui.components.icons.hugeicon import icon
LiteralOrientation = Literal["horizontal", "vertical"]
ITEMS_TYPE = list[dict[str, str | Component]]
class ClassNames:
"""Class names for accordion components."""
ROOT = "flex flex-col justify-center shadow-small border border-secondary-a4 divide-y divi... | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 3