instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
e_block_markdown,
}
comp2 = component_map.copy()
comp2["codeblock"] = code_block_markdown_dark
comp2["ul"] = lambda items: unordered_list_comp(items=items)
comp2["ol"] = lambda items: ordered_list_comp(items=items)
xd = flexdown.Flexdown(
block_types=[
DemoOnly,
DemoBlock,
AlertBlock,
... | def markdown_with_shiki(*args, **kwargs):
"""Wrapper for the markdown component with a customized component map.
Uses the experimental Shiki-based code block (rx._x.code_block)
instead of the default CodeBlock component for code blocks.
Note: This wrapper should be removed once the default codeblock
... | |
"""The main Reflex website."""
import os
|
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_pat... | import sys |
"""The main Reflex website."""
import os
import sys
|
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_path
# This number disc... | import reflex as rx |
"""The main Reflex website."""
import os
import sys
import reflex as rx
|
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_path
# This number discovered by trial and error on Win... | import reflex_enterprise as rxe |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
|
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_path
# This number discovered by trial and error on Windows 11 w/ Node 18, any
# ... | from pcweb import styles |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
|
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_path
# This number discovered by trial and error on Windows 11 w/ Node 18, any
# higher and the prod build fails with EMFILE... | from pcweb.meta.meta import favicons_links |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
|
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_path
# This number discovered by trial and error on Windows 11 w/ Node 18, any
# higher and the prod build fails with EMFILE error.
WINDOWS_MAX_ROUTES = int(os.envi... | from pcweb.pages import page404, routes |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
|
from pcweb.telemetry import get_pixel_website_trackers
from pcweb.whitelist import _check_whitelisted_path
# This number discovered by trial and error on Windows 11 w/ Node 18, any
# higher and the prod build fails with EMFILE error.
WINDOWS_MAX_ROUTES = int(os.environ.get("REFLEX_WEB_WINDOWS_MAX_ROUTES", "100"))
# ... | from pcweb.pages.docs import exec_blocks, outblocks |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
|
from pcweb.whitelist import _check_whitelisted_path
# This number discovered by trial and error on Windows 11 w/ Node 18, any
# higher and the prod build fails with EMFILE error.
WINDOWS_MAX_ROUTES = int(os.environ.get("REFLEX_WEB_WINDOWS_MAX_ROUTES", "100"))
# Execute all the exec blocks in the documents.
for doc, ... | from pcweb.telemetry import get_pixel_website_trackers |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_tracker... |
# This number discovered by trial and error on Windows 11 w/ Node 18, any
# higher and the prod build fails with EMFILE error.
WINDOWS_MAX_ROUTES = int(os.environ.get("REFLEX_WEB_WINDOWS_MAX_ROUTES", "100"))
# Execute all the exec blocks in the documents.
for doc, href in outblocks:
exec_blocks(doc, href)
# Cre... | from pcweb.whitelist import _check_whitelisted_path |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_tracker... |
# Execute all the exec blocks in the documents.
for doc, href in outblocks:
exec_blocks(doc, href)
# Create the app.
app = rxe.App(
style=styles.BASE_STYLE,
stylesheets=styles.STYLESHEETS,
app_wraps={},
theme=rx.theme(
has_background=True,
radius="large",
accent_color="vio... | WINDOWS_MAX_ROUTES = int(os.environ.get("REFLEX_WEB_WINDOWS_MAX_ROUTES", "100")) |
"""The main Reflex website."""
import os
import sys
import reflex as rx
import reflex_enterprise as rxe
from pcweb import styles
from pcweb.meta.meta import favicons_links
from pcweb.pages import page404, routes
from pcweb.pages.docs import exec_blocks, outblocks
from pcweb.telemetry import get_pixel_website_tracker... |
# Create the app.
app = rxe.App(
style=styles.BASE_STYLE,
stylesheets=styles.STYLESHEETS,
app_wraps={},
theme=rx.theme(
has_background=True,
radius="large",
accent_color="violet",
),
head_components=get_pixel_website_trackers()
+ favicons_links()
+ [
rx.... | for doc, href in outblocks:
exec_blocks(doc, href) |
YLE,
stylesheets=styles.STYLESHEETS,
app_wraps={},
theme=rx.theme(
has_background=True,
radius="large",
accent_color="violet",
),
head_components=get_pixel_website_trackers()
+ favicons_links()
+ [
rx.el.link(
rel="preconnect",
href="ht... |
# Add the pages to the app.
for route in routes:
# print(f"Adding route: {route}")
if _check_whitelisted_path(route.path):
page_args = {
"component": route.component,
"route": route.path,
"title": route.title,
"image": (
"/previews/index_... | if sys.platform == "win32":
if not os.environ.get("REFLEX_WEB_WINDOWS_OVERRIDE"):
raise RuntimeError(
"reflex-web cannot be built on Windows due to EMFILE error. To build a "
"subset of pages for testing, set environment variable REFLEX_WEB_WINDOWS_OVERRIDE."
)
routes = r... |
ESHEETS,
app_wraps={},
theme=rx.theme(
has_background=True,
radius="large",
accent_color="violet",
),
head_components=get_pixel_website_trackers()
+ favicons_links()
+ [
rx.el.link(
rel="preconnect",
href="https://fonts.googleapis.com",
... |
routes = routes[:WINDOWS_MAX_ROUTES]
# Add the pages to the app.
for route in routes:
# print(f"Adding route: {route}")
if _check_whitelisted_path(route.path):
page_args = {
"component": route.component,
"route": route.path,
"title": route.title,
"im... | if not os.environ.get("REFLEX_WEB_WINDOWS_OVERRIDE"):
raise RuntimeError(
"reflex-web cannot be built on Windows due to EMFILE error. To build a "
"subset of pages for testing, set environment variable REFLEX_WEB_WINDOWS_OVERRIDE."
) |
href="https://fonts.googleapis.com",
),
rx.el.link(
rel="preconnect",
href="https://fonts.gstatic.com",
cross_origin="",
),
rx.el.link(
href="https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400... |
# Add the pages to the app.
for route in routes:
# print(f"Adding route: {route}")
if _check_whitelisted_path(route.path):
page_args = {
"component": route.component,
"route": route.path,
"title": route.title,
"image": (
"/previews/index_... | routes = routes[:WINDOWS_MAX_ROUTES] |
),
rx.el.link(
href="https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=IBM+Plex+Mono:ital,wght@0,500;0,600;1,600&family=Source+Code+Pro:wght@400;500&display=swap&family=J... |
# Add the description only if it is not None
if route.description is not None:
page_args["description"] = route.description
# Add the extra meta data only if it is not None
if route.meta is not None:
page_args["meta"].extend(route.meta)
# Call add_page ... | page_args = {
"component": route.component,
"route": route.path,
"title": route.title,
"image": (
"/previews/index_preview.webp" if route.image is None else route.image
),
"meta": [
{"name": "theme-color", "content":... |
pp is TOO BIG to build on Windows, so explicitly disallow it except for testing
if sys.platform == "win32":
if not os.environ.get("REFLEX_WEB_WINDOWS_OVERRIDE"):
raise RuntimeError(
"reflex-web cannot be built on Windows due to EMFILE error. To build a "
"subset of pages for testing,... |
# Add the extra meta data only if it is not None
if route.meta is not None:
page_args["meta"].extend(route.meta)
# Call add_page with the dynamically constructed arguments
app.add_page(**page_args)
# Add redirects
redirects = [
("/docs/enterprise/ag-grid/index", "/docs... | if route.description is not None:
page_args["description"] = route.description |
ly disallow it except for testing
if sys.platform == "win32":
if not os.environ.get("REFLEX_WEB_WINDOWS_OVERRIDE"):
raise RuntimeError(
"reflex-web cannot be built on Windows due to EMFILE error. To build a "
"subset of pages for testing, set environment variable REFLEX_WEB_WINDOWS_O... |
# Add the extra meta data only if it is not None
if route.meta is not None:
page_args["meta"].extend(route.meta)
# Call add_page with the dynamically constructed arguments
app.add_page(**page_args)
# Add redirects
redirects = [
("/docs/enterprise/ag-grid/index", "/docs... | page_args["description"] = route.description |
ERRIDE"):
raise RuntimeError(
"reflex-web cannot be built on Windows due to EMFILE error. To build a "
"subset of pages for testing, set environment variable REFLEX_WEB_WINDOWS_OVERRIDE."
)
routes = routes[:WINDOWS_MAX_ROUTES]
# Add the pages to the app.
for route in routes:... |
# Call add_page with the dynamically constructed arguments
app.add_page(**page_args)
# Add redirects
redirects = [
("/docs/enterprise/ag-grid/index", "/docs/enterprise/ag-grid"),
("/docs/ai-builder/integrations", "/docs/ai-builder/integrations/overview"),
("/docs/ai-builder/app-lifecycle"... | if route.meta is not None:
page_args["meta"].extend(route.meta) |
arding/how-reflex-works",
),
# Recipes
("/docs/recipes/auth", "/docs/recipes"),
("/docs/recipes/layout", "/docs/recipes"),
("/docs/recipes/others", "/docs/recipes"),
("/docs/recipes/content", "/docs/recipes"),
# redirect previous chakra links to the new chakra docs
("/docs/library/chakra... |
app.add_page(page404.component, route=page404.path)
| for source, target in redirects:
if _check_whitelisted_path(target):
app.add_page(lambda: rx.fragment(), route=source, on_load=rx.redirect(target)) |
# Recipes
("/docs/recipes/auth", "/docs/recipes"),
("/docs/recipes/layout", "/docs/recipes"),
("/docs/recipes/others", "/docs/recipes"),
("/docs/recipes/content", "/docs/recipes"),
# redirect previous chakra links to the new chakra docs
("/docs/library/chakra/[[...splat]]", "https://chakra.refle... |
app.add_page(page404.component, route=page404.path)
| if _check_whitelisted_path(target):
app.add_page(lambda: rx.fragment(), route=source, on_load=rx.redirect(target)) |
"""Manage routing for the application."""
|
from typing import Callable
import reflex as rx
from reflex.base import Base
class Route(Base):
"""A page route."""
# The path of the route.
path: str
# The page title.
title: str | None = None
# The page description.
description: str | None = None
# The page image.
image: st... | import inspect |
"""Manage routing for the application."""
import inspect
|
import reflex as rx
from reflex.base import Base
class Route(Base):
"""A page route."""
# The path of the route.
path: str
# The page title.
title: str | None = None
# The page description.
description: str | None = None
# The page image.
image: str | None = None
# The p... | from typing import Callable |
"""Manage routing for the application."""
import inspect
from typing import Callable
|
from reflex.base import Base
class Route(Base):
"""A page route."""
# The path of the route.
path: str
# The page title.
title: str | None = None
# The page description.
description: str | None = None
# The page image.
image: str | None = None
# The page extra meta data.
... | import reflex as rx |
"""Manage routing for the application."""
import inspect
from typing import Callable
import reflex as rx
|
class Route(Base):
"""A page route."""
# The path of the route.
path: str
# The page title.
title: str | None = None
# The page description.
description: str | None = None
# The page image.
image: str | None = None
# The page extra meta data.
meta: list[dict[str, str]... | from reflex.base import Base |
"""Manage routing for the application."""
import inspect
from typing import Callable
import reflex as rx
from reflex.base import Base
class Route(Base):
"""A page route."""
# The path of the route.
path: str
# The page title.
title: str | None = None
# The page description.
descriptio... |
def get_path(component_fn: Callable):
"""Get the path for a page based on the file location.
Args:
component_fn: The component function for the page.
"""
module = inspect.getmodule(component_fn)
# Create a path based on the module name.
return (
module.__name__.replace(".", ... | def __hash__(self):
"""Hash the route based on the path and title."""
return hash(f"{self.path}-{self.title}") |
path: str
# The page title.
title: str | None = None
# The page description.
description: str | None = None
# The page image.
image: str | None = None
# The page extra meta data.
meta: list[dict[str, str]] | None = None
# Background color for the page.
background_color: str... |
# Create a path based on the module name.
return (
module.__name__.replace(".", "/").replace("_", "-").split("pcweb/pages")[1]
+ "/"
)
| module = inspect.getmodule(component_fn) |
import os
from datetime import datetime
from typing import Any
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Wai... | import contextlib | |
import contextlib
import os
|
from typing import Any
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Waitlist(rx.Model, table=True):
email: ... | from datetime import datetime |
import contextlib
import os
from datetime import datetime
|
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Waitlist(rx.Model, table=True):
email: str
date_created: d... | from typing import Any |
import contextlib
import os
from datetime import datetime
from typing import Any
|
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Waitlist(rx.Model, table=True):
email: str
date_created: datetime = Fiel... | import httpx |
import contextlib
import os
from datetime import datetime
from typing import Any
import httpx
|
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Waitlist(rx.Model, table=True):
email: str
date_created: datetime = Field(default_factory=da... | import reflex as rx |
import contextlib
import os
from datetime import datetime
from typing import Any
import httpx
import reflex as rx
|
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Waitlist(rx.Model, table=True):
email: str
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
class IndexState(rx.State):
"""Hold the st... | from email_validator import EmailNotValidError, ValidatedEmail, validate_email |
import contextlib
import os
from datetime import datetime
from typing import Any
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
|
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
class Waitlist(rx.Model, table=True):
email: str
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
class IndexState(rx.State):
"""Hold the state for the home page."""
... | from sqlmodel import Field |
import contextlib
import os
from datetime import datetime
from typing import Any
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
|
class Waitlist(rx.Model, table=True):
email: str
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
class IndexState(rx.State):
"""Hold the state for the home page."""
# Whether the user signed up for the newsletter.
signed_up: bool = False
# Whether to show t... | from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
) |
import contextlib
import os
from datetime import datetime
from typing import Any
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_U... |
class IndexState(rx.State):
"""Hold the state for the home page."""
# Whether the user signed up for the newsletter.
signed_up: bool = False
# Whether to show the confetti.
show_confetti: bool = False
@rx.event(background=True)
async def send_contact_to_webhook(
self,
e... | class Waitlist(rx.Model, table=True):
email: str
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False) |
import contextlib
import os
from datetime import datetime
from typing import Any
import httpx
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email
from sqlmodel import Field
from pcweb.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_U... |
response.raise_for_status()
@rx.event(background=True)
async def add_contact_to_loops(
self,
email: str,
):
url: str = f"{API_BASE_URL_LOOPS}/contacts/create"
loops_api_key: str | None = os.getenv("LOOPS_API_KEY")
if loops_api_key is None:
pr... | response = await client.post(
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
json={
"email": email,
},
) |
eld(default_factory=datetime.utcnow, nullable=False)
class IndexState(rx.State):
"""Hold the state for the home page."""
# Whether the user signed up for the newsletter.
signed_up: bool = False
# Whether to show the confetti.
show_confetti: bool = False
@rx.event(background=True)
async ... |
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {loops_api_key}",
}
try:
async with httpx.AsyncClient() as client:
response = await client.post(
url,
headers=headers,
... | if loops_api_key is None:
print("Loops API key does not exist")
return |
e)
async def send_contact_to_webhook(
self,
email: str,
) -> None:
with contextlib.suppress(httpx.HTTPError):
async with httpx.AsyncClient() as client:
response = await client.post(
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
... |
response.raise_for_status() # Raise an exception for HTTP errors (4xx and 5xx)
except httpx.HTTPError as e:
print(f"An error occurred: {e}")
@rx.event
def signup_for_another_user(self):
self.signed_up = False
@rx.event(background=True)
async def signup(
... | response = await client.post(
url,
headers=headers,
json={
"email": email,
},
) |
)
response.raise_for_status()
@rx.event(background=True)
async def add_contact_to_loops(
self,
email: str,
):
url: str = f"{API_BASE_URL_LOOPS}/contacts/create"
loops_api_key: str | None = os.getenv("LOOPS_API_KEY")
if loops_api_key is None:... |
@rx.event(background=True)
async def signup(
self,
form_data: dict[str, Any],
):
"""Sign the user up for the newsletter."""
email: str | None = None
if email_to_validate := form_data.get("input_email"):
try:
validated_email: ValidatedEmai... | def signup_for_another_user(self):
self.signed_up = False |
for_status()
@rx.event(background=True)
async def add_contact_to_loops(
self,
email: str,
):
url: str = f"{API_BASE_URL_LOOPS}/contacts/create"
loops_api_key: str | None = os.getenv("LOOPS_API_KEY")
if loops_api_key is None:
print("Loops API key does not ... |
@rx.event(background=True)
async def signup(
self,
form_data: dict[str, Any],
):
"""Sign the user up for the newsletter."""
email: str | None = None
if email_to_validate := form_data.get("input_email"):
try:
validated_email: ValidatedEmai... | self.signed_up = False |
try:
async with httpx.AsyncClient() as client:
response = await client.post(
url,
headers=headers,
json={
"email": email,
},
)
response.raise_for_status()... |
except EmailNotValidError as e:
# Alert the error message.
yield rx.toast.warning(
str(e),
style={
"border": "1px solid #3C3646",
"background": "linear-gradient(218deg, #1D1B23 -35.66%, ... | email = validated_email.normalized |
def signup(
self,
form_data: dict[str, Any],
):
"""Sign the user up for the newsletter."""
email: str | None = None
if email_to_validate := form_data.get("input_email"):
try:
validated_email: ValidatedEmail = validate_email(
ema... |
yield
yield [
rx.call_script(
f"try {{ ko.identify('{email}'); }} catch(e) {{ console.warn('Koala identify failed:', e); }}"
),
rx.toast.success("Thanks for signing up to the Newsletter!"),
]
| self.signed_up = True |
"""A list of whitelist paths that should be built.
If the list is empty, all pages will be built.
Tips:
- Ensure that the path starts with a forward slash '/'.
- Do not include a trailing slash '/' at the end of the path.
Examples:
- Correct: WHITELISTED_PAGES = ["/docs/getting-started/introduction"]
- Incorrect: WHI... |
def _check_whitelisted_path(path: str):
if len(WHITELISTED_PAGES) == 0:
return True
# If the path is the root, always build it.
if path == "/":
return True
if len(WHITELISTED_PAGES) == 1 and WHITELISTED_PAGES[0] == "/":
return False
for whitelisted_path in WHITELISTED_P... | WHITELISTED_PAGES = [] |
"""A list of whitelist paths that should be built.
If the list is empty, all pages will be built.
Tips:
- Ensure that the path starts with a forward slash '/'.
- Do not include a trailing slash '/' at the end of the path.
Examples:
- Correct: WHITELISTED_PAGES = ["/docs/getting-started/introduction"]
- Incorrect: WHI... |
# If the path is the root, always build it.
if path == "/":
return True
if len(WHITELISTED_PAGES) == 1 and WHITELISTED_PAGES[0] == "/":
return False
for whitelisted_path in WHITELISTED_PAGES:
if path.startswith(whitelisted_path):
return True
return False
| if len(WHITELISTED_PAGES) == 0:
return True |
"""A list of whitelist paths that should be built.
If the list is empty, all pages will be built.
Tips:
- Ensure that the path starts with a forward slash '/'.
- Do not include a trailing slash '/' at the end of the path.
Examples:
- Correct: WHITELISTED_PAGES = ["/docs/getting-started/introduction"]
- Incorrect: WHI... |
if len(WHITELISTED_PAGES) == 1 and WHITELISTED_PAGES[0] == "/":
return False
for whitelisted_path in WHITELISTED_PAGES:
if path.startswith(whitelisted_path):
return True
return False
| if path == "/":
return True |
"""A list of whitelist paths that should be built.
If the list is empty, all pages will be built.
Tips:
- Ensure that the path starts with a forward slash '/'.
- Do not include a trailing slash '/' at the end of the path.
Examples:
- Correct: WHITELISTED_PAGES = ["/docs/getting-started/introduction"]
- Incorrect: WHI... |
return False
| if path.startswith(whitelisted_path):
return True |
import reflex as rx
from pcweb.components.icons import get_icon
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875rem] py-2 relative transition-bg bor... | from typing import Callable, Literal | |
from typing import Callable, Literal
|
from pcweb.components.icons import get_icon
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875rem] py-2 relative transition-bg border-t"
after_class_n... | import reflex as rx |
from typing import Callable, Literal
import reflex as rx
|
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875rem] py-2 relative transition-bg border-t"
after_class_name = "after:absolute after:inset-[1px] after... | from pcweb.components.icons import get_icon |
from typing import Callable, Literal
import reflex as rx
from pcweb.components.icons import get_icon
|
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875rem] py-2 relative transition-bg border-t"
after_class_name = "after:absolute after:inset-[1px] after:border-t after:rounded-[11px] after:border-white after:opacity-[0.22]"
def get_variant_class(v... | LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
] |
from typing import Callable, Literal
import reflex as rx
from pcweb.components.icons import get_icon
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
|
after_class_name = "after:absolute after:inset-[1px] after:border-t after:rounded-[11px] after:border-white after:opacity-[0.22]"
def get_variant_class(variant: str) -> str:
return (
f"bg-gradient-to-b from-(--{variant}-9) to-(--{variant}-9) hover:to-(--{variant}-10) text-white"
+ " "
)
va... | default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875rem] py-2 relative transition-bg border-t" |
from typing import Callable, Literal
import reflex as rx
from pcweb.components.icons import get_icon
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875... |
def get_variant_class(variant: str) -> str:
return (
f"bg-gradient-to-b from-(--{variant}-9) to-(--{variant}-9) hover:to-(--{variant}-10) text-white"
+ " "
)
variant_styles = {
"primary": {
"class_name": get_variant_class("violet"),
},
"success": {
"class_name": ... | after_class_name = "after:absolute after:inset-[1px] after:border-t after:rounded-[11px] after:border-white after:opacity-[0.22]" |
from typing import Callable, Literal
import reflex as rx
from pcweb.components.icons import get_icon
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-center px-[0.875... |
variant_styles = {
"primary": {
"class_name": get_variant_class("violet"),
},
"success": {
"class_name": get_variant_class("green"),
},
"destructive": {
"class_name": get_variant_class("red"),
},
"muted": {
"class_name": "bg-slate-3 hover:bg-slate-5 text-sl... | def get_variant_class(variant: str) -> str:
return (
f"bg-gradient-to-b from-(--{variant}-9) to-(--{variant}-9) hover:to-(--{variant}-10) text-white"
+ " "
) |
from reflex.experimental.client_state import ClientStateVar
from pcweb.components.icons.hugeicons import hi
from pcweb.components.icons.icons import get_icon
@rx.memo
def install_command(
command: str,
show_dollar_sign: bool = True,
) -> rx.Component:
copied = ClientStateVar.create("is_copied", default=... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.hugeicons import hi
from pcweb.components.icons.icons import get_icon
@rx.memo
def install_command(
command: str,
show_dollar_sign: bool = True,
) -> rx.Component:
copied = ClientStateVar.create("is_copied", default=False, global_ref=False)
return rx.el.button(
rx... | from reflex.experimental.client_state import ClientStateVar |
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
|
from pcweb.components.icons.icons import get_icon
@rx.memo
def install_command(
command: str,
show_dollar_sign: bool = True,
) -> rx.Component:
copied = ClientStateVar.create("is_copied", default=False, global_ref=False)
return rx.el.button(
rx.cond(
copied.value,
hi(
... | from pcweb.components.icons.hugeicons import hi |
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from pcweb.components.icons.hugeicons import hi
|
@rx.memo
def install_command(
command: str,
show_dollar_sign: bool = True,
) -> rx.Component:
copied = ClientStateVar.create("is_copied", default=False, global_ref=False)
return rx.el.button(
rx.cond(
copied.value,
hi(
"tick-02",
size=14... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
from reflex.experimental.client_state import ClientStateVar
from pcweb.components.icons.hugeicons import hi
from pcweb.components.icons.icons import get_icon
@rx.memo
def install_command(
command: str,
show_dollar_sign: bool = True,
) -> rx.Component:
|
return rx.el.button(
rx.cond(
copied.value,
hi(
"tick-02",
size=14,
class_name="ml-[5px] shrink-0",
),
hi("copy-01", size=14, class_name="shrink-0 ml-[5px]"),
),
rx.text(
rx.cond(
... | copied = ClientStateVar.create("is_copied", default=False, global_ref=False) |
e=14, class_name="shrink-0 ml-[5px]"),
),
rx.text(
rx.cond(
show_dollar_sign,
f"${command}",
command,
),
as_="p",
class_name="font-small text-start truncate",
),
title=command,
on_clic... |
def code_card(app: dict) -> rx.Component:
return rx.flex(
rx.box(
rx.el.a(
rx.image(
src=app["image_url"],
loading="lazy",
alt="Image preview for app: " + app["name"],
class_name="size-full duratio... | def repo(repo_url: str) -> rx.Component:
return rx.link(
get_icon(icon="new_tab", class_name="p-[5px]"),
href=repo_url,
is_external=True,
class_name="border-slate-5 bg-slate-1 hover:bg-slate-3 shadow-small border border-solid rounded-md text-slate-9 hover:!text-slate-9 no-underline t... |
from reflex.event import EventHandler, passthrough_event_spec
from pcweb.components.utils.twmerge import cn
def dialog(
content: rx.Component,
trigger: rx.Component,
class_name: str = "",
trigger_class_name: str = "",
on_open_change: EventHandler[passthrough_event_spec(bool)] | None = None,
... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.utils.twmerge import cn
def dialog(
content: rx.Component,
trigger: rx.Component,
class_name: str = "",
trigger_class_name: str = "",
on_open_change: EventHandler[passthrough_event_spec(bool)] | None = None,
**props,
) -> rx.Component:
return rx.dialog.root(
... | from reflex.event import EventHandler, passthrough_event_spec |
import reflex as rx
from reflex.event import EventHandler, passthrough_event_spec
|
def dialog(
content: rx.Component,
trigger: rx.Component,
class_name: str = "",
trigger_class_name: str = "",
on_open_change: EventHandler[passthrough_event_spec(bool)] | None = None,
**props,
) -> rx.Component:
return rx.dialog.root(
rx.dialog.trigger(
trigger,
... | from pcweb.components.utils.twmerge import cn |
def hint(
text: str,
content: rx.Component,
side: str = "top",
align: str = "center",
active: bool = False,
class_name: str = "",
**props,
) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(content, height="fit-content"),
rx.hover_card.content(
... | import reflex as rx | |
import reflex as rx
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background-... | import datetime | |
import datetime
|
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background-image:radial-gradient... | import reflex as rx |
import datetime
import reflex as rx
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%... |
# October 25, 2025 12:01 AM PDT (UTC-7) = October 25, 2025 07:01 AM UTC
DEADLINE = datetime.datetime(2025, 10, 25, 7, 1, tzinfo=datetime.UTC)
class HostingBannerState(rx.State):
show_banner: rx.Field[bool] = rx.field(False)
force_hide_banner: rx.Field[bool] = rx.field(False)
@rx.event
def hide_bann... | POST_LINK = "https://www.producthunt.com/products/reflex-5?launch=reflex-7" |
import datetime
import reflex as rx
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%... |
class HostingBannerState(rx.State):
show_banner: rx.Field[bool] = rx.field(False)
force_hide_banner: rx.Field[bool] = rx.field(False)
@rx.event
def hide_banner(self):
self.force_hide_banner = True
@rx.event
def check_deadline(self):
if datetime.datetime.now(datetime.UTC) < D... | DEADLINE = datetime.datetime(2025, 10, 25, 7, 1, tzinfo=datetime.UTC) |
import datetime
import reflex as rx
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%... |
@rx.event
def check_deadline(self):
if datetime.datetime.now(datetime.UTC) < DEADLINE:
self.show_banner = True
@rx.var
def is_banner_visible(self) -> bool:
return self.show_banner and not self.force_hide_banner
def timer():
remove_negative_sign = rx.vars.function.Arg... | def hide_banner(self):
self.force_hide_banner = True |
import datetime
import reflex as rx
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%... |
@rx.event
def check_deadline(self):
if datetime.datetime.now(datetime.UTC) < DEADLINE:
self.show_banner = True
@rx.var
def is_banner_visible(self) -> bool:
return self.show_banner and not self.force_hide_banner
def timer():
remove_negative_sign = rx.vars.function.Arg... | self.force_hide_banner = True |
e
import reflex as rx
def glow() -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background... |
@rx.var
def is_banner_visible(self) -> bool:
return self.show_banner and not self.force_hide_banner
def timer():
remove_negative_sign = rx.vars.function.ArgsFunctionOperation.create(
args_names=("t",),
return_expr=rx.vars.sequence.string_replace_operation(
rx.Var("t")... | def check_deadline(self):
if datetime.datetime.now(datetime.UTC) < DEADLINE:
self.show_banner = True |
) -> rx.Component:
return rx.box(
class_name="absolute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background-image:radial-gradient(50%_50%_at_... |
@rx.var
def is_banner_visible(self) -> bool:
return self.show_banner and not self.force_hide_banner
def timer():
remove_negative_sign = rx.vars.function.ArgsFunctionOperation.create(
args_names=("t",),
return_expr=rx.vars.sequence.string_replace_operation(
rx.Var("t")... | if datetime.datetime.now(datetime.UTC) < DEADLINE:
self.show_banner = True |
ute w-[120rem] h-[23.75rem] flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(235,228,255,0.95)_0%,_rgba(252,252,253,0.00)_100%... |
@rx.var
def is_banner_visible(self) -> bool:
return self.show_banner and not self.force_hide_banner
def timer():
remove_negative_sign = rx.vars.function.ArgsFunctionOperation.create(
args_names=("t",),
return_expr=rx.vars.sequence.string_replace_operation(
rx.Var("t")... | self.show_banner = True |
rounded-[120rem] left-1/2 -translate-x-1/2 z-[0] top-[-16rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(235,228,255,0.95)_0%,_rgba(252,252,253,0.00)_100%)] saturate-200 dark:saturate-100 group-h... |
def timer():
remove_negative_sign = rx.vars.function.ArgsFunctionOperation.create(
args_names=("t",),
return_expr=rx.vars.sequence.string_replace_operation(
rx.Var("t").to(str), "-", ""
),
)
return rx.el.div(
rx.moment(
date=DEADLINE,
d... | def is_banner_visible(self) -> bool:
return self.show_banner and not self.force_hide_banner |
%,_rgba(58,45,118,1)_0%,_rgba(21,22,24,0.00)_100%)] [background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(235,228,255,0.95)_0%,_rgba(252,252,253,0.00)_100%)] saturate-200 dark:saturate-100 group-hover:saturate-300 transition-[saturate] dark:group-hover:saturate-100",
)
POST_LINK = "https://www.producthunt.co... |
return rx.el.div(
rx.moment(
date=DEADLINE,
duration_from_now=True,
format="DD[d] HH[h] mm[m] ss[s]",
custom_attrs={"filter": remove_negative_sign},
interval=1000,
class_name="font-medium text-sm",
),
class_name="items... | remove_negative_sign = rx.vars.function.ArgsFunctionOperation.create(
args_names=("t",),
return_expr=rx.vars.sequence.string_replace_operation(
rx.Var("t").to(str), "-", ""
),
) |
import reflex as rx
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "rounded-full w-8 h-8 inline-flex items-center justify-center cursor-pointer relative border-t border-[rgba(255,255,255,0.21)] shrink-0"
after_class_name = "after:absolute after:i... | from typing import Callable, Literal | |
from typing import Callable, Literal
|
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "rounded-full w-8 h-8 inline-flex items-center justify-center cursor-pointer relative border-t border-[rgba(255,255,255,0.21)] shrink-0"
after_class_name = "after:absolute after:inset-[1px] after:bord... | import reflex as rx |
from typing import Callable, Literal
import reflex as rx
|
default_class_name = "rounded-full w-8 h-8 inline-flex items-center justify-center cursor-pointer relative border-t border-[rgba(255,255,255,0.21)] shrink-0"
after_class_name = "after:absolute after:inset-[1px] after:border-t after:rounded-[11px] after:border-white after:opacity-[0.22]"
def get_variant_class(varian... | LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
] |
from typing import Callable, Literal
import reflex as rx
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
|
after_class_name = "after:absolute after:inset-[1px] after:border-t after:rounded-[11px] after:border-white after:opacity-[0.22]"
def get_variant_class(variant: str) -> str:
return (
f"bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-9] hover:to-[--{variant}-10] text-white"
+ " "
)
var... | default_class_name = "rounded-full w-8 h-8 inline-flex items-center justify-center cursor-pointer relative border-t border-[rgba(255,255,255,0.21)] shrink-0" |
from typing import Callable, Literal
import reflex as rx
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "rounded-full w-8 h-8 inline-flex items-center justify-center cursor-pointer relative border-t border-[rgba(255,255,255,0.21)] shrink-0"
|
def get_variant_class(variant: str) -> str:
return (
f"bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-9] hover:to-[--{variant}-10] text-white"
+ " "
)
variant_styles = {
"primary": {
"class_name": get_variant_class("violet"),
},
"success": {
"class_name": ... | after_class_name = "after:absolute after:inset-[1px] after:border-t after:rounded-[11px] after:border-white after:opacity-[0.22]" |
import reflex as rx
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"xs", "sm", "md", "lg", "icon-xs", "icon-sm", "icon-md", "icon-lg"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer ... | from typing import Dict, Literal | |
from typing import Dict, Literal
|
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"xs", "sm", "md", "lg", "icon-xs", "icon-sm", "icon-md", "icon-lg"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-cen... | import reflex as rx |
from typing import Dict, Literal
import reflex as rx
|
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"xs", "sm", "md", "lg", "icon-xs", "icon-sm", "icon-md", "icon-lg"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrin... | from pcweb.components.utils.twmerge import cn |
from typing import Dict, Literal
import reflex as rx
from pcweb.components.utils.twmerge import cn
|
LiteralButtonSize = Literal[
"xs", "sm", "md", "lg", "icon-xs", "icon-sm", "icon-md", "icon-lg"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrink-0 font-sans disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 ... | LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
] |
from typing import Dict, Literal
import reflex as rx
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
|
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrink-0 font-sans disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 disabled:!text-slate-8 transition-bg outline-none peer-placeholder-shown:!bg-slate-3 peer-placeholder-... | LiteralButtonSize = Literal[
"xs", "sm", "md", "lg", "icon-xs", "icon-sm", "icon-md", "icon-lg"
] |
xt-slate-9 font-medium",
"destructive": f"{get_variant_bg_cn('red')} text-[#FCFCFD] font-semibold",
"outline": "bg-slate-1 hover:bg-slate-3 text-secondary-11 font-medium border border-slate-5",
},
}
def resources_button(
*children: rx.Component | str | rx.Var,
variant: LiteralButtonVariant... |
if variant not in BUTTON_STYLES["variant"]:
raise ValueError(
f"Invalid variant: {variant}. Must be one of {list(BUTTON_STYLES['variant'].keys())}"
)
variant_class = BUTTON_STYLES["variant"][variant]
# variant_class = variant_class() if callable(variant_class) else variant_class... | if size not in BUTTON_STYLES["size"]:
raise ValueError(
f"Invalid size: {size}. Must be one of {list(BUTTON_STYLES['size'].keys())}"
) |
ary-11 font-medium border border-slate-5",
},
}
def resources_button(
*children: rx.Component | str | rx.Var,
variant: LiteralButtonVariant = "primary",
size: LiteralButtonSize = "sm",
class_name: str | rx.Var[str] = "",
**props,
) -> rx.Component:
"""Create a button component.
Args:
... |
variant_class = BUTTON_STYLES["variant"][variant]
# variant_class = variant_class() if callable(variant_class) else variant_class
internal_classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
]
return rx.el.button(
*children,
class_na... | if variant not in BUTTON_STYLES["variant"]:
raise ValueError(
f"Invalid variant: {variant}. Must be one of {list(BUTTON_STYLES['variant'].keys())}"
) |
alButtonSize = "sm",
class_name: str | rx.Var[str] = "",
**props,
) -> rx.Component:
"""Create a button component.
Args:
*children: The content of the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional):... |
# variant_class = variant_class() if callable(variant_class) else variant_class
internal_classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
]
return rx.el.button(
*children,
class_name=cn(internal_classes, class_name),
**props,
... | variant_class = BUTTON_STYLES["variant"][variant] |
*children: The content of the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional): The button size. Defaults to "sm".
class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "".
... |
return rx.el.button(
*children,
class_name=cn(internal_classes, class_name),
**props,
)
| internal_classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
] |
def logo(class_name: str = "") -> rx.Component:
return rx.link(
rx.fragment(
rx.image(
src="/logos/light/reflex.svg",
alt="Reflex Logo",
class_name="shrink-0 block dark:hidden" + class_name,
),
rx.image(
s... | import reflex as rx | |
import reflex as rx
class Marquee(rx.NoSSRComponent):
"""Marquee component."""
library = "react-fast-marquee@1.6.5"
tag = "Marquee"
is_default = True
# Behavior props
auto_fill: rx.Var[bool] = rx.Var.create(True)
play: rx.Var[bool] = rx.Var.create(True)
pause_on_hover: rx.Var[bool]... | from typing import Literal, Union | |
from typing import Literal, Union
|
class Marquee(rx.NoSSRComponent):
"""Marquee component."""
library = "react-fast-marquee@1.6.5"
tag = "Marquee"
is_default = True
# Behavior props
auto_fill: rx.Var[bool] = rx.Var.create(True)
play: rx.Var[bool] = rx.Var.create(True)
pause_on_hover: rx.Var[bool] = rx.Var.create(True... | import reflex as rx |
from typing import Literal, Union
import reflex as rx
class Marquee(rx.NoSSRComponent):
"""Marquee component."""
|
tag = "Marquee"
is_default = True
# Behavior props
auto_fill: rx.Var[bool] = rx.Var.create(True)
play: rx.Var[bool] = rx.Var.create(True)
pause_on_hover: rx.Var[bool] = rx.Var.create(True)
pause_on_click: rx.Var[bool] = rx.Var.create(False)
direction: rx.Var[Literal["left", "right", "u... | library = "react-fast-marquee@1.6.5" |
from typing import Literal, Union
import reflex as rx
class Marquee(rx.NoSSRComponent):
"""Marquee component."""
library = "react-fast-marquee@1.6.5"
|
is_default = True
# Behavior props
auto_fill: rx.Var[bool] = rx.Var.create(True)
play: rx.Var[bool] = rx.Var.create(True)
pause_on_hover: rx.Var[bool] = rx.Var.create(True)
pause_on_click: rx.Var[bool] = rx.Var.create(False)
direction: rx.Var[Literal["left", "right", "up", "down"]] = rx.Va... | tag = "Marquee" |
from typing import Literal, Union
import reflex as rx
class Marquee(rx.NoSSRComponent):
"""Marquee component."""
library = "react-fast-marquee@1.6.5"
tag = "Marquee"
|
# Behavior props
auto_fill: rx.Var[bool] = rx.Var.create(True)
play: rx.Var[bool] = rx.Var.create(True)
pause_on_hover: rx.Var[bool] = rx.Var.create(True)
pause_on_click: rx.Var[bool] = rx.Var.create(False)
direction: rx.Var[Literal["left", "right", "up", "down"]] = rx.Var.create("left")
... | is_default = True |
from typing import Literal, Union
import reflex as rx
class Marquee(rx.NoSSRComponent):
"""Marquee component."""
library = "react-fast-marquee@1.6.5"
tag = "Marquee"
is_default = True
# Behavior props
auto_fill: rx.Var[bool] = rx.Var.create(True)
play: rx.Var[bool] = rx.Var.create(True)... | marquee = Marquee.create | |
import reflex as rx
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"sm", "md", "lg", "xl", "icon-sm", "icon-md", "icon-lg", "icon-xl"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer ... | from typing import Any, Dict, Literal, Optional | |
from typing import Any, Dict, Literal, Optional
|
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"sm", "md", "lg", "xl", "icon-sm", "icon-md", "icon-lg", "icon-xl"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-cen... | import reflex as rx |
from typing import Any, Dict, Literal, Optional
import reflex as rx
|
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"sm", "md", "lg", "xl", "icon-sm", "icon-md", "icon-lg", "icon-xl"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrin... | from pcweb.components.utils.twmerge import cn |
from typing import Any, Dict, Literal, Optional
import reflex as rx
from pcweb.components.utils.twmerge import cn
|
LiteralButtonSize = Literal[
"sm", "md", "lg", "xl", "icon-sm", "icon-md", "icon-lg", "icon-xl"
]
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrink-0 font-sans disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 ... | LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.