instruction
stringlengths
0
1k
input
stringlengths
1
1k
output
stringlengths
10
6.51k
return upload_data = await first_file.read() if len(upload_data) > MAX_FILE_SIZE_BYTES: yield rx.toast.error( f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB" ) yield rx.cancel_upload("upload-image-button") self.is_uploading = False self._images = None return self._images.append( ImageData( data=upload_data, mime_type=first_file.content_type, ) ) self.is_uploading = False @rx.event def cancel_upload(self, index: int): if self.is_uploading or index < 0: self.is_uploading = False self._images = None return rx.cancel_upload("upload-image-button") elif self._images is not None: if index < len(self._images): self._images.pop(index) @rx.var
def integration_text(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom", ), rx.el.span( text, class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold", ), class_name="inline-flex items-center gap-2 align-bottom mx-1", ) def integration_text_light_dark(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom dark:hidden", ), rx.image( src=f"/landing/integrations/dark/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 align-text-bottom hidden dark:inline-block", ), rx.e
def image_data_uris(self) -> list[str]: """Return the image data.""" if self._images is None: return [] return [ f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}" for image in self._images ]
d_data) > MAX_FILE_SIZE_BYTES: yield rx.toast.error( f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB" ) yield rx.cancel_upload("upload-image-button") self.is_uploading = False self._images = None return self._images.append( ImageData( data=upload_data, mime_type=first_file.content_type, ) ) self.is_uploading = False @rx.event def cancel_upload(self, index: int): if self.is_uploading or index < 0: self.is_uploading = False self._images = None return rx.cancel_upload("upload-image-button") elif self._images is not None: if index < len(self._images): self._images.pop(index) @rx.var def image_data_uris(self) -> list[str]: """Return the image data."""
return [ f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}" for image in self._images ] def integration_text(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom", ), rx.el.span( text, class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold", ), class_name="inline-flex items-center gap-2 align-bottom mx-1", ) def integration_text_light_dark(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom dark:hidden", ), rx.image( src=f"/landing/int
if self._images is None: return []
age-button") self.is_uploading = False self._images = None return self._images.append( ImageData( data=upload_data, mime_type=first_file.content_type, ) ) self.is_uploading = False @rx.event def cancel_upload(self, index: int): if self.is_uploading or index < 0: self.is_uploading = False self._images = None return rx.cancel_upload("upload-image-button") elif self._images is not None: if index < len(self._images): self._images.pop(index) @rx.var def image_data_uris(self) -> list[str]: """Return the image data.""" if self._images is None: return [] return [ f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}" for image in self._images ]
def integration_text_light_dark(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom dark:hidden", ), rx.image( src=f"/landing/integrations/dark/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 align-text-bottom hidden dark:inline-block", ), rx.el.span( text, class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold", ), class_name="inline-flex items-center gap-2 align-bottom mx-1", ) @rx.memo def one_upload_file_display(file_data_uri: str, index: int) -> rx.Component: return ui.preview_card( trigger=rx.box( rx.el.button( rx.html("""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"> <
def integration_text(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom", ), rx.el.span( text, class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold", ), class_name="inline-flex items-center gap-2 align-bottom mx-1", )
self._images = None return rx.cancel_upload("upload-image-button") elif self._images is not None: if index < len(self._images): self._images.pop(index) @rx.var def image_data_uris(self) -> list[str]: """Return the image data.""" if self._images is None: return [] return [ f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}" for image in self._images ] def integration_text(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom", ), rx.el.span( text, class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold", ), class_name="inline-flex items-center gap-2 align-bottom mx-1", )
@rx.memo def one_upload_file_display(file_data_uri: str, index: int) -> rx.Component: return ui.preview_card( trigger=rx.box( rx.el.button( rx.html("""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"> <path opacity="0.64" d="M8 0.833344C11.9581 0.833344 15.1667 4.04197 15.1667 8.00001C15.1667 11.9581 11.9581 15.1667 8 15.1667C4.04196 15.1667 0.833336 11.9581 0.833336 8.00001C0.833336 4.04197 4.04196 0.833344 8 0.833344Z" fill="#1C2024"/> <path d="M6.4205 5.48325C6.15866 5.26969 5.77265 5.28477 5.52857 5.52882C5.28458 5.7729 5.26945 6.15893 5.483 6.42075L5.52857 6.47153L7.05719 8.00018L5.52922 9.52884C5.26897 9.78918 5.26888 10.2112 5.52922 10.4715C5.78957 10.7316 6.21164 10.7318 6.47193 10.4715L7.99992 8.94291L9.52792 10.4715L9.57872 10.5171C9.84046 10.7306 10.2265 10.7154 10.4707 10.4715C10.7147 10.2276 10.7302 9.84144 10.5169 9.57958L10.4707 9.52884L8.94199 8.00018L10.4713 6.47153L10.5169 6.4
def integration_text_light_dark(text: str, integration: str) -> rx.Component: return rx.el.span( rx.image( src=f"/landing/integrations/light/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom dark:hidden", ), rx.image( src=f"/landing/integrations/dark/{integration}.svg", class_name="size-7 pointer-events-none shrink-0 align-text-bottom hidden dark:inline-block", ), rx.el.span( text, class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold", ), class_name="inline-flex items-center gap-2 align-bottom mx-1", )
.7306 10.2265 10.7154 10.4707 10.4715C10.7147 10.2276 10.7302 9.84144 10.5169 9.57958L10.4707 9.52884L8.94199 8.00018L10.4713 6.47153L10.5169 6.42075C10.7304 6.15892 10.7153 5.7729 10.4713 5.52882C10.2272 5.28477 9.84119 5.26969 9.57932 5.48325L9.52859 5.52882L7.99992 7.05744L6.47128 5.52882L6.4205 5.48325Z" fill="white"/> </svg>"""), type="button", on_click=SubmitPromptState.cancel_upload(index), class_name="absolute top-1 right-1 rounded-full transition-colors flex justify-center items-center size-[0.89581rem]", ), rx.image( src=file_data_uri, class_name="rounded-lg object-cover h-full w-full aspect-square border border-slate-3", ), class_name="flex items-center gap-2 relative size-12 shrink-0", ), content=rx.image( src=file_data_uri, class_name="rounded-lg object-cover h-full max-h-[10rem] w-auto", ), )
def prompt_box() -> rx.Component: return rx.el.form( rx.el.div( rx.cond( show_default_prompt.value, rx.el.span( rx.el.span( "Build a dashboard with ", integration_text( "Databricks", "databricks", ), "metrics,", class_name="animate-[prompt-box-line] animate-duration-[200ms] animate-ease-out origin-left absolute top-3 left-5 h-10 pointer-events-none", ), rx.el.span( "use ", integration_text_light_dark( "Okta", "okta", ), "for auth, ping me on ", integration_text( "Slack",
def uploaded_file_display() -> rx.Component: return rx.foreach( SubmitPromptState.image_data_uris, lambda file_data_uri, index: one_upload_file_display( file_data_uri=file_data_uri, index=index, ), )
type or file too large (Max {MAX_FILE_SIZE_MB}MB, up to {MAX_IMAGES_COUNT} files)." ), max_files=MAX_IMAGES_COUNT, max_size=MAX_FILE_SIZE_BYTES, multiple=True, id="upload-image-button", ), ui.button( "Build Your App", size="lg", variant="primary", loading=SubmitPromptState.is_processing, on_click=show_default_prompt.set_value(False), class_name="rounded-[10px] font-semibold", ), class_name="flex flex-row items-center gap-2 justify-between", ), on_mount=rx.call_script( f""" if (window.innerWidth < 1024) {{ {show_default_prompt.set}(false); }} """ ), on_submit=SubmitPromptState.redirect_to_ai_builder, class_name="flex flex-col gap-4 mt-6 max-w-[29rem] w-full", )
def hero() -> rx.Component: return rx.el.section( numbers_pattern( side="left", class_name="lg:top-[65px] top-[45px] lg:h-[calc(100%-65px)] h-[calc(100%-45px)]", ), numbers_pattern( side="right", class_name="lg:top-[65px] top-[45px] lg:h-[calc(100%-65px)] h-[calc(100%-45px)]", ), rx.el.h1( """Build From Prompt to Production App, In Seconds""", class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center lg:max-w-[576px] word-wrap break-words lg:whitespace-pre", ), prompt_box(), class_name="flex flex-col justify-center items-center gap-4 mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 pb-[3rem] pt-28 lg:pt-[8rem] relative lg:overflow-hidden overflow-hidden z-[1] bg-transparent lg:bg-slate-1 lg:px-4", )
from pcweb.components.icons import get_icon from pcweb.components.icons.hugeicons import hi def header() -> rx.Component: return rx.box( rx.image( src="/landing/patterns/light/pattern_hosting.webp", class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none", ), rx.box( hi("cloud-server", class_name="shrink-0"), rx.el.span("Hosting Platform", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-amber-11", ), rx.el.h2( """Deploy, manage, and scale. A complete infrastructure for your app""", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( """Deploy anywhere — Reflex supports all major cloud providers, including Databricks, AWS, GCP, Azure, Snowflake and more.""",
import reflex as rx
import reflex as rx
from pcweb.components.icons.hugeicons import hi def header() -> rx.Component: return rx.box( rx.image( src="/landing/patterns/light/pattern_hosting.webp", class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none", ), rx.box( hi("cloud-server", class_name="shrink-0"), rx.el.span("Hosting Platform", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-amber-11", ), rx.el.h2( """Deploy, manage, and scale. A complete infrastructure for your app""", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( """Deploy anywhere — Reflex supports all major cloud providers, including Databricks, AWS, GCP, Azure, Snowflake and more.""", class_name="text-slate-11 text-sm fon
from pcweb.components.icons import get_icon
import reflex as rx from pcweb.components.icons import get_icon
def header() -> rx.Component: return rx.box( rx.image( src="/landing/patterns/light/pattern_hosting.webp", class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none", ), rx.box( hi("cloud-server", class_name="shrink-0"), rx.el.span("Hosting Platform", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-amber-11", ), rx.el.h2( """Deploy, manage, and scale. A complete infrastructure for your app""", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( """Deploy anywhere — Reflex supports all major cloud providers, including Databricks, AWS, GCP, Azure, Snowflake and more.""", class_name="text-slate-11 text-sm font-medium text-center text-balance word-wrap brea
from pcweb.components.icons.hugeicons import hi
src="/landing/hosting_features/light/card.webp", class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none dark:hidden", ), rx.image( src="/landing/hosting_features/dark/card.webp", class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none dark:block hidden", ), class_name="justify-center items-center relative overflow-hidden w-full lg:flex hidden", ), class_name="flex flex-col lg:flex-row max-w-[64.19rem] mx-auto w-full border-x-0 lg:border-x border-slate-3 divide-x-0 lg:divide-x divide-slate-3", ) def graph() -> rx.Component: return rx.box( rx.image( src="/hosting_graphing.svg", class_name="w-full h-[10rem]", ), class_name="flex flex-col lg:flex-row max-w-[64.19rem] mx-auto w-full border-x-0 lg:border-x border-slate-3 divide-x-0 lg:divide-x divide-slate-3 p-10", )
def hosting_section() -> rx.Component: return rx.el.section( header(), # graph(), content(), class_name="flex flex-col mx-auto w-full max-w-[84.19rem] relative", )
import reflex_ui as ui from pcweb.components.numbers_pattern import numbers_pattern def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("WorkflowSquare08Icon", class_name="shrink-0"), rx.el.span("Integrations", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Integrate With Your Platforms", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Build entire app flow using powerful integrations.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def intregation_card( first_integration: str, secon
import reflex as rx
import reflex as rx
from pcweb.components.numbers_pattern import numbers_pattern def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("WorkflowSquare08Icon", class_name="shrink-0"), rx.el.span("Integrations", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Integrate With Your Platforms", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Build entire app flow using powerful integrations.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def intregation_card( first_integration: str, second_integration: str,
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("WorkflowSquare08Icon", class_name="shrink-0"), rx.el.span("Integrations", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Integrate With Your Platforms", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Build entire app flow using powerful integrations.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def intregation_card( first_integration: str, second_integration: str, class_name: str = "", ): first_light_dark_path = rx.color
from pcweb.components.numbers_pattern import numbers_pattern
s_pattern import numbers_pattern def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("WorkflowSquare08Icon", class_name="shrink-0"), rx.el.span("Integrations", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Integrate With Your Platforms", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Build entire app flow using powerful integrations.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def intregation_card( first_integration: str, second_integration: str, class_name: str = "", ):
second_light_dark_path = rx.color_mode_cond( f"/landing/integrations/light/{second_integration}.svg", f"/landing/integrations/dark/{second_integration}.svg", ) return rx.el.div( rx.el.div( rx.image( src=first_light_dark_path, class_name="size-7 pointer-events-none shrink-0", ), class_name=ui.cn( "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 size-14 rounded-[0.625rem] border border-slate-5 dark:border-[#1C2024] shadow-medium bg-white-1 z-[3] flex justify-center items-center", "animate-[fade-scale-out] animate-duration-[8000ms] animate-ease-out animate-infinite", class_name, ), ), rx.el.div( rx.image( src=second_light_dark_path, class_name="size-7 pointer-events-none shrink-0", ), class_name=ui.cn( "absolute left
first_light_dark_path = rx.color_mode_cond( f"/landing/integrations/light/{first_integration}.svg", f"/landing/integrations/dark/{first_integration}.svg", )
rx.el.span("Integrations", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Integrate With Your Platforms", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Build entire app flow using powerful integrations.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def intregation_card( first_integration: str, second_integration: str, class_name: str = "", ): first_light_dark_path = rx.color_mode_cond( f"/landing/integrations/light/{first_integration}.svg", f"/landing/integrations/dark/{first_integration}.svg", )
return rx.el.div( rx.el.div( rx.image( src=first_light_dark_path, class_name="size-7 pointer-events-none shrink-0", ), class_name=ui.cn( "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 size-14 rounded-[0.625rem] border border-slate-5 dark:border-[#1C2024] shadow-medium bg-white-1 z-[3] flex justify-center items-center", "animate-[fade-scale-out] animate-duration-[8000ms] animate-ease-out animate-infinite", class_name, ), ), rx.el.div( rx.image( src=second_light_dark_path, class_name="size-7 pointer-events-none shrink-0", ), class_name=ui.cn( "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 size-14 rounded-[0.625rem] border border-slate-5 dark:border-[#1C2024] shadow-medium bg-white-1 z-[3] flex justify-center items-center",
second_light_dark_path = rx.color_mode_cond( f"/landing/integrations/light/{second_integration}.svg", f"/landing/integrations/dark/{second_integration}.svg", )
color="#60646C" stop-opacity="0.2"/> <stop offset="1" stop-color="#1C2024" stop-opacity="0"/> </linearGradient> </defs> </svg>""", class_name=f"absolute z-[0] opacity-50 dark:opacity-100 {class_name}", ) def ellipse_svg(class_name: str = "") -> rx.Component: return rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="236" height="1" viewBox="0 0 236 1" fill="none"> <g filter="url(#filter0_f_18006_49950)"> <circle cx="118" cy="1" r="86" fill="#6E56CF"/> </g> <defs> <filter id="filter0_f_18006_49950" x="0" y="-117" width="236" height="236" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_18006_49950"/> </filter> </defs> </svg>""", class_name=f"absolute z-[1] {class_name}", )
def lines() -> rx.Component: return rx.el.div( rx.el.div( line_svg(class_name="left-[12rem] top-1/2 -translate-y-1/2"), # ellipse_svg( # class_name="top-1/2 -translate-y-1/2 mix-blend-darken z-[0] animate-[ellipse-slide-left] animate-duration-[8000ms] animate-ease-in-out animate-infinite" # ), class_name="relative overflow-hidden", ), rx.el.div( # ellipse_svg( # class_name="top-1/2 -translate-y-1/2 mix-blend-darken z-[0] animate-[ellipse-slide-right] animate-duration-[8000ms] animate-ease-in-out animate-infinite" # ), line_svg(class_name="right-[12rem] top-1/2 -translate-y-1/2 scale-x-[-1]"), class_name="relative overflow-hidden", ), class_name="grid grid-cols-2 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 lg:w-[43.5rem] w-[36rem] z-[0] overflow-hidden h-[20rem]", ) def integrations_row() -> r
def r_logo_card() -> rx.Component: return rx.el.div( rx.el.div( rx.image( src="/landing/integrations/light/r_logo.svg", class_name="h-8 w-autopointer-events-none shrink-0 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", ), class_name="size-15 rounded-lg border border-slate-5 dark:border-[#1C2024] shadow-large bg-white-1 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[2]", ), class_name="size-18 rounded-xl border border-slate-3 dark:border-[#1C2024] shadow-large bg-white/76 dark:bg-slate-1 relative z-[2]", )
te-1 relative z-[2]", ) def lines() -> rx.Component: return rx.el.div( rx.el.div( line_svg(class_name="left-[12rem] top-1/2 -translate-y-1/2"), # ellipse_svg( # class_name="top-1/2 -translate-y-1/2 mix-blend-darken z-[0] animate-[ellipse-slide-left] animate-duration-[8000ms] animate-ease-in-out animate-infinite" # ), class_name="relative overflow-hidden", ), rx.el.div( # ellipse_svg( # class_name="top-1/2 -translate-y-1/2 mix-blend-darken z-[0] animate-[ellipse-slide-right] animate-duration-[8000ms] animate-ease-in-out animate-infinite" # ), line_svg(class_name="right-[12rem] top-1/2 -translate-y-1/2 scale-x-[-1]"), class_name="relative overflow-hidden", ), class_name="grid grid-cols-2 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 lg:w-[43.5rem] w-[36rem] z-[0] overflow-hidden h-[20rem]", )
def integrations() -> rx.Component: return rx.el.section( numbers_pattern(side="left", class_name="left-0 top-0"), numbers_pattern(side="right", class_name="right-0 top-0"), header(), integrations_row(), class_name="flex flex-col items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 relative overflow-hidden lg:border-t lg:pb-26 pb-20 pt-20", )
def integrations_row() -> rx.Component: return rx.el.div( lines(), rx.el.div( intregation_card("supabase", "langchain"), intregation_card("openai", "databricks"), intregation_card("stripe", "anthropic"), class_name="flex flex-col gap-10", ), r_logo_card(), rx.el.div( intregation_card("aws", "gcp"), intregation_card("azure", "oracle"), intregation_card("databricks", "reflex"), class_name="flex flex-col gap-10", ), class_name="flex flex-row items-center lg:gap-[7.5rem] gap-14 mt-10 relative max-lg:w-full justify-center", )
import reflex_ui as ui from pcweb.components.numbers_pattern import numbers_pattern from pcweb.pages.framework.views.frontend_features import frontend_grid def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("Layers01Icon", class_name="shrink-0"), rx.el.span( "Open Source", class_name="text-sm font-semibold", ), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Built on our Open Source Python Framework", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Reflex is the only solution that gives you full flexibility while staying in the language your team knows - Python.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whi
import reflex as rx
import reflex as rx
from pcweb.components.numbers_pattern import numbers_pattern from pcweb.pages.framework.views.frontend_features import frontend_grid def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("Layers01Icon", class_name="shrink-0"), rx.el.span( "Open Source", class_name="text-sm font-semibold", ), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Built on our Open Source Python Framework", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Reflex is the only solution that gives you full flexibility while staying in the language your team knows - Python.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", )
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
from pcweb.pages.framework.views.frontend_features import frontend_grid def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("Layers01Icon", class_name="shrink-0"), rx.el.span( "Open Source", class_name="text-sm font-semibold", ), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Built on our Open Source Python Framework", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Reflex is the only solution that gives you full flexibility while staying in the language your team knows - Python.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto
from pcweb.components.numbers_pattern import numbers_pattern
import reflex as rx import reflex_ui as ui from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("Layers01Icon", class_name="shrink-0"), rx.el.span( "Open Source", class_name="text-sm font-semibold", ), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Built on our Open Source Python Framework", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "Reflex is the only solution that gives you full flexibility while staying in the language your team knows - Python.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def os_bento() -> rx.Componen
from pcweb.pages.framework.views.frontend_features import frontend_grid
import reflex_ui as ui from pcweb.components.icons import get_icon from pcweb.constants import CONTRIBUTORS, DISCORD_USERS, GITHUB_STARS def stat_card( stat: str, text: str, icon: str, class_name: str = "", color: str = "!text-slate-9" ) -> rx.Component: return rx.box( rx.box( get_icon(icon, class_name=color), rx.text(text, class_name="font-base text-slate-9"), class_name="flex flex-row gap-2 items-center", ), rx.text(stat, class_name="font-x-large text-slate-12"), class_name=ui.cn( "flex flex-col gap-2 w-full p-10 items-center", class_name, ), ) def stats_grid() -> rx.Component: return rx.box( stat_card( stat=f"{GITHUB_STARS:,}+", text="Stars", icon="star", ), stat_card( stat=f"{CONTRIBUTORS:,}+", text="Contributors", icon="fork", ), stat_card(
import reflex as rx
import reflex as rx
from pcweb.components.icons import get_icon from pcweb.constants import CONTRIBUTORS, DISCORD_USERS, GITHUB_STARS def stat_card( stat: str, text: str, icon: str, class_name: str = "", color: str = "!text-slate-9" ) -> rx.Component: return rx.box( rx.box( get_icon(icon, class_name=color), rx.text(text, class_name="font-base text-slate-9"), class_name="flex flex-row gap-2 items-center", ), rx.text(stat, class_name="font-x-large text-slate-12"), class_name=ui.cn( "flex flex-col gap-2 w-full p-10 items-center", class_name, ), ) def stats_grid() -> rx.Component: return rx.box( stat_card( stat=f"{GITHUB_STARS:,}+", text="Stars", icon="star", ), stat_card( stat=f"{CONTRIBUTORS:,}+", text="Contributors", icon="fork", ), stat_card( stat=f"{DISCORD_USERS
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
from pcweb.constants import CONTRIBUTORS, DISCORD_USERS, GITHUB_STARS def stat_card( stat: str, text: str, icon: str, class_name: str = "", color: str = "!text-slate-9" ) -> rx.Component: return rx.box( rx.box( get_icon(icon, class_name=color), rx.text(text, class_name="font-base text-slate-9"), class_name="flex flex-row gap-2 items-center", ), rx.text(stat, class_name="font-x-large text-slate-12"), class_name=ui.cn( "flex flex-col gap-2 w-full p-10 items-center", class_name, ), ) def stats_grid() -> rx.Component: return rx.box( stat_card( stat=f"{GITHUB_STARS:,}+", text="Stars", icon="star", ), stat_card( stat=f"{CONTRIBUTORS:,}+", text="Contributors", icon="fork", ), stat_card( stat=f"{DISCORD_USERS:,}+", text="Discord",
from pcweb.components.icons import get_icon
import reflex as rx import reflex_ui as ui from pcweb.components.icons import get_icon
def stat_card( stat: str, text: str, icon: str, class_name: str = "", color: str = "!text-slate-9" ) -> rx.Component: return rx.box( rx.box( get_icon(icon, class_name=color), rx.text(text, class_name="font-base text-slate-9"), class_name="flex flex-row gap-2 items-center", ), rx.text(stat, class_name="font-x-large text-slate-12"), class_name=ui.cn( "flex flex-col gap-2 w-full p-10 items-center", class_name, ), ) def stats_grid() -> rx.Component: return rx.box( stat_card( stat=f"{GITHUB_STARS:,}+", text="Stars", icon="star", ), stat_card( stat=f"{CONTRIBUTORS:,}+", text="Contributors", icon="fork", ), stat_card( stat=f"{DISCORD_USERS:,}+", text="Discord", icon="discord_navbar", ), class_name="grid grid-cols
from pcweb.constants import CONTRIBUTORS, DISCORD_USERS, GITHUB_STARS
import reflex as rx from pcweb.components.icons import get_icon from pcweb.components.new_button import button # Outcomes features data OUTCOMES_FEATURES = [ { "title": "Dedicated Engineer", "description": "An expert engineer is assigned to your team to build your first app.", "icon": "backend_auth", }, { "title": "Fast Time to Launch", "description": "Get your first app up and running quickly with expert guidance.", "icon": "zap", }, { "title": "Guaranteed Success", "description": "We ensure your app reaches a successful state before handoff.", "icon": "star", }, { "title": "Training and Enablement", "description": "Hands-on training so your team can maintain and extend your app.", "icon": "document_code", }, ] def header() -> rx.Component: return rx.box( rx.el.h3( "Deliver Outcomes", class_name="lg:text-3xl text-xl f
from typing import List
from typing import List
from pcweb.components.icons import get_icon from pcweb.components.new_button import button # Outcomes features data OUTCOMES_FEATURES = [ { "title": "Dedicated Engineer", "description": "An expert engineer is assigned to your team to build your first app.", "icon": "backend_auth", }, { "title": "Fast Time to Launch", "description": "Get your first app up and running quickly with expert guidance.", "icon": "zap", }, { "title": "Guaranteed Success", "description": "We ensure your app reaches a successful state before handoff.", "icon": "star", }, { "title": "Training and Enablement", "description": "Hands-on training so your team can maintain and extend your app.", "icon": "document_code", }, ] def header() -> rx.Component: return rx.box( rx.el.h3( "Deliver Outcomes", class_name="lg:text-3xl text-xl font-semibold text-sla
import reflex as rx
from typing import List import reflex as rx from pcweb.components.icons import get_icon
# Outcomes features data OUTCOMES_FEATURES = [ { "title": "Dedicated Engineer", "description": "An expert engineer is assigned to your team to build your first app.", "icon": "backend_auth", }, { "title": "Fast Time to Launch", "description": "Get your first app up and running quickly with expert guidance.", "icon": "zap", }, { "title": "Guaranteed Success", "description": "We ensure your app reaches a successful state before handoff.", "icon": "star", }, { "title": "Training and Enablement", "description": "Hands-on training so your team can maintain and extend your app.", "icon": "document_code", }, ] def header() -> rx.Component: return rx.box( rx.el.h3( "Deliver Outcomes", class_name="lg:text-3xl text-xl font-semibold text-slate-12 text-balance", ), rx.el.p( "Your success, guaranteed. Real
from pcweb.components.new_button import button
from typing import List import reflex as rx from pcweb.components.icons import get_icon from pcweb.components.new_button import button # Outcomes features data
def header() -> rx.Component: return rx.box( rx.el.h3( "Deliver Outcomes", class_name="lg:text-3xl text-xl font-semibold text-slate-12 text-balance", ), rx.el.p( "Your success, guaranteed. Real outcomes, real support", class_name="lg:text-3xl text-xl font-semibold text-slate-9 text-balance", ), class_name="flex text-center flex-col py-[3.5rem] 2xl:border-x border-t border-slate-3 max-w-[64.19rem] mx-auto w-full max-lg:border-b", ) def outcomes_showcase() -> rx.Component: """Central outcomes showcase component with prominent display.""" return rx.box( # Radial background rx.html( """<svg width="338" height="478" viewBox="0 0 338 478" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect x="23.824" y="210.094" width="275" height="107" rx="53.5" transform="rotate(-9 23.824 210.094)" stroke="var(--c-slate-5)"/> <rect x="8.14869" y="208.44" width="299" hei
OUTCOMES_FEATURES = [ { "title": "Dedicated Engineer", "description": "An expert engineer is assigned to your team to build your first app.", "icon": "backend_auth", }, { "title": "Fast Time to Launch", "description": "Get your first app up and running quickly with expert guidance.", "icon": "zap", }, { "title": "Guaranteed Success", "description": "We ensure your app reaches a successful state before handoff.", "icon": "star", }, { "title": "Training and Enablement", "description": "Hands-on training so your team can maintain and extend your app.", "icon": "document_code", }, ]
from typing import List import reflex as rx from pcweb.components.icons import get_icon from pcweb.components.new_button import button # Outcomes features data OUTCOMES_FEATURES = [ { "title": "Dedicated Engineer", "description": "An expert engineer is assigned to your team to build your first app.", "icon": "backend_auth", }, { "title": "Fast Time to Launch", "description": "Get your first app up and running quickly with expert guidance.", "icon": "zap", }, { "title": "Guaranteed Success", "description": "We ensure your app reaches a successful state before handoff.", "icon": "star", }, { "title": "Training and Enablement", "description": "Hands-on training so your team can maintain and extend your app.", "icon": "document_code", }, ]
def outcomes_showcase() -> rx.Component: """Central outcomes showcase component with prominent display.""" return rx.box( # Radial background rx.html( """<svg width="338" height="478" viewBox="0 0 338 478" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect x="23.824" y="210.094" width="275" height="107" rx="53.5" transform="rotate(-9 23.824 210.094)" stroke="var(--c-slate-5)"/> <rect x="8.14869" y="208.44" width="299" height="131" rx="65.5" transform="rotate(-12 8.14869 208.44)" stroke="var(--c-slate-5)"/> <rect x="-8.05511" y="208.366" width="323" height="155" rx="77.5" transform="rotate(-15 -8.05511 208.366)" stroke="var(--c-slate-5)"/> <rect x="-24.6649" y="209.92" width="347" height="179" rx="89.5" transform="rotate(-18 -24.6649 209.92)" stroke="var(--c-slate-5)"/> <rect x="-41.5532" y="213.144" width="371" height="203" rx="101.5" transform="rotate(-21 -41.5532 213.144)" stroke="var(--c-slate-5)"/> <rect x="-58.5899" y="218.069" width="395"
def header() -> rx.Component: return rx.box( rx.el.h3( "Deliver Outcomes", class_name="lg:text-3xl text-xl font-semibold text-slate-12 text-balance", ), rx.el.p( "Your success, guaranteed. Real outcomes, real support", class_name="lg:text-3xl text-xl font-semibold text-slate-9 text-balance", ), class_name="flex text-center flex-col py-[3.5rem] 2xl:border-x border-t border-slate-3 max-w-[64.19rem] mx-auto w-full max-lg:border-b", )
e-x-1/2 -translate-y-1/2 z-[-2] pointer-events-none", ), rx.box( rx.el.h2( "Powerful Outcomes", class_name="text-2xl font-semibold text-slate-12 text-center", ), rx.el.p( "Everything you need to achieve your goals", class_name="font-medium text-slate-9 text-center mt-2 text-base", ), rx.link( button( "Book a demo", size="xl", ), underline="none", is_external=True, href="/demo", class_name="mt-6", ), class_name="flex flex-col justify-center items-center h-full", ), class_name="desktop-only h-full w-full flex flex-col justify-center items-center relative overflow-hidden row-span-2 col-span-1 lg:border border-slate-3 max-lg:py-[3rem] lg:p-1 lg:border-t-0 lg:border-b-0", )
def _card_header(title: str, icon: str) -> rx.Component: """Card header with icon and title.""" return rx.box( get_icon(icon, class_name="!text-slate-9"), rx.el.h3(title, class_name="text-slate-12 text-base font-semibold"), class_name="flex flex-row items-center gap-2", ) def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" ) def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center.""" grid_items = [] # Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items def outcomes_grid() -> rx.C
def outcomes_card( title: str, description: str, icon: str, cols: str = "1", class_name: str = "", ) -> rx.Component: """Individual outcomes feature card component.""" return rx.box( rx.box( _card_header(title, icon), _card_description(description), class_name="flex flex-col gap-[0.875rem]", ), class_name=f"col-span-{cols} lg:h-[11rem] overflow-hidden p-8 w-full {class_name} lg:first:border-b border-slate-3 lg:last:border-t", )
), underline="none", is_external=True, href="/demo", class_name="mt-6", ), class_name="flex flex-col justify-center items-center h-full", ), class_name="desktop-only h-full w-full flex flex-col justify-center items-center relative overflow-hidden row-span-2 col-span-1 lg:border border-slate-3 max-lg:py-[3rem] lg:p-1 lg:border-t-0 lg:border-b-0", ) def outcomes_card( title: str, description: str, icon: str, cols: str = "1", class_name: str = "", ) -> rx.Component: """Individual outcomes feature card component.""" return rx.box( rx.box( _card_header(title, icon), _card_description(description), class_name="flex flex-col gap-[0.875rem]", ), class_name=f"col-span-{cols} lg:h-[11rem] overflow-hidden p-8 w-full {class_name} lg:first:border-b border-slate-3 lg:last:border-t", )
def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" ) def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center.""" grid_items = [] # Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items def outcomes_grid() -> rx.Component: """Main outcomes features grid component.""" return rx.box( *_create_grid_items(), class_name="grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-2 lg:grid-rows-2 w-full lg:border border-b-0 border-slate-3 max-lg:divide-y divide-slate-3", ) def outcomes_section() -> rx.Comp
def _card_header(title: str, icon: str) -> rx.Component: """Card header with icon and title.""" return rx.box( get_icon(icon, class_name="!text-slate-9"), rx.el.h3(title, class_name="text-slate-12 text-base font-semibold"), class_name="flex flex-row items-center gap-2", )
justify-center items-center relative overflow-hidden row-span-2 col-span-1 lg:border border-slate-3 max-lg:py-[3rem] lg:p-1 lg:border-t-0 lg:border-b-0", ) def outcomes_card( title: str, description: str, icon: str, cols: str = "1", class_name: str = "", ) -> rx.Component: """Individual outcomes feature card component.""" return rx.box( rx.box( _card_header(title, icon), _card_description(description), class_name="flex flex-col gap-[0.875rem]", ), class_name=f"col-span-{cols} lg:h-[11rem] overflow-hidden p-8 w-full {class_name} lg:first:border-b border-slate-3 lg:last:border-t", ) def _card_header(title: str, icon: str) -> rx.Component: """Card header with icon and title.""" return rx.box( get_icon(icon, class_name="!text-slate-9"), rx.el.h3(title, class_name="text-slate-12 text-base font-semibold"), class_name="flex flex-row items-center gap-2", )
def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center.""" grid_items = [] # Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items def outcomes_grid() -> rx.Component: """Main outcomes features grid component.""" return rx.box( *_create_grid_items(), class_name="grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-2 lg:grid-rows-2 w-full lg:border border-b-0 border-slate-3 max-lg:divide-y divide-slate-3", ) def outcomes_section() -> rx.Component: return rx.el.section( header(), rx.box( outcomes_grid(), class_name="flex flex-row max-w-[64.19rem] justify-center w-full", ), cl
def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" )
, description: str, icon: str, cols: str = "1", class_name: str = "", ) -> rx.Component: """Individual outcomes feature card component.""" return rx.box( rx.box( _card_header(title, icon), _card_description(description), class_name="flex flex-col gap-[0.875rem]", ), class_name=f"col-span-{cols} lg:h-[11rem] overflow-hidden p-8 w-full {class_name} lg:first:border-b border-slate-3 lg:last:border-t", ) def _card_header(title: str, icon: str) -> rx.Component: """Card header with icon and title.""" return rx.box( get_icon(icon, class_name="!text-slate-9"), rx.el.h3(title, class_name="text-slate-12 text-base font-semibold"), class_name="flex flex-row items-center gap-2", ) def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" )
def outcomes_grid() -> rx.Component: """Main outcomes features grid component.""" return rx.box( *_create_grid_items(), class_name="grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-2 lg:grid-rows-2 w-full lg:border border-b-0 border-slate-3 max-lg:divide-y divide-slate-3", ) def outcomes_section() -> rx.Component: return rx.el.section( header(), rx.box( outcomes_grid(), class_name="flex flex-row max-w-[64.19rem] justify-center w-full", ), class_name="flex flex-col mx-auto w-full max-w-[84.19rem] relative justify-center items-center", )
def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center.""" grid_items = [] # Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items
outcomes feature card component.""" return rx.box( rx.box( _card_header(title, icon), _card_description(description), class_name="flex flex-col gap-[0.875rem]", ), class_name=f"col-span-{cols} lg:h-[11rem] overflow-hidden p-8 w-full {class_name} lg:first:border-b border-slate-3 lg:last:border-t", ) def _card_header(title: str, icon: str) -> rx.Component: """Card header with icon and title.""" return rx.box( get_icon(icon, class_name="!text-slate-9"), rx.el.h3(title, class_name="text-slate-12 text-base font-semibold"), class_name="flex flex-row items-center gap-2", ) def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" ) def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center."""
# Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items def outcomes_grid() -> rx.Component: """Main outcomes features grid component.""" return rx.box( *_create_grid_items(), class_name="grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-2 lg:grid-rows-2 w-full lg:border border-b-0 border-slate-3 max-lg:divide-y divide-slate-3", ) def outcomes_section() -> rx.Component: return rx.el.section( header(), rx.box( outcomes_grid(), class_name="flex flex-row max-w-[64.19rem] justify-center w-full", ), class_name="flex flex-col mx-auto w-full max-w-[84.19rem] relative justify-center items-center", )
grid_items = []
-3 lg:last:border-t", ) def _card_header(title: str, icon: str) -> rx.Component: """Card header with icon and title.""" return rx.box( get_icon(icon, class_name="!text-slate-9"), rx.el.h3(title, class_name="text-slate-12 text-base font-semibold"), class_name="flex flex-row items-center gap-2", ) def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" ) def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center.""" grid_items = [] # Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items
def outcomes_section() -> rx.Component: return rx.el.section( header(), rx.box( outcomes_grid(), class_name="flex flex-row max-w-[64.19rem] justify-center w-full", ), class_name="flex flex-col mx-auto w-full max-w-[84.19rem] relative justify-center items-center", )
def outcomes_grid() -> rx.Component: """Main outcomes features grid component.""" return rx.box( *_create_grid_items(), class_name="grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-2 lg:grid-rows-2 w-full lg:border border-b-0 border-slate-3 max-lg:divide-y divide-slate-3", )
ex-row items-center gap-2", ) def _card_description(description: str) -> rx.Component: """Card description text.""" return rx.el.p( description, class_name="text-slate-9 font-medium text-sm text-start" ) def _create_grid_items() -> List[rx.Component]: """Creates the grid items with outcomes showcase in the center.""" grid_items = [] # Add first outcomes card grid_items.append(outcomes_card(**OUTCOMES_FEATURES[0])) # Add the central outcomes showcase grid_items.append(outcomes_showcase()) # Add remaining outcomes cards grid_items.extend([outcomes_card(**feature) for feature in OUTCOMES_FEATURES[1:]]) return grid_items def outcomes_grid() -> rx.Component: """Main outcomes features grid component.""" return rx.box( *_create_grid_items(), class_name="grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-2 lg:grid-rows-2 w-full lg:border border-b-0 border-slate-3 max-lg:divide-y divide-slate-3", )
def outcomes_section() -> rx.Component: return rx.el.section( header(), rx.box( outcomes_grid(), class_name="flex flex-row max-w-[64.19rem] justify-center w-full", ), class_name="flex flex-col mx-auto w-full max-w-[84.19rem] relative justify-center items-center", )
from pcweb.components.icons.icons import get_icon from pcweb.pages.docs import getting_started def product_card( number: int, name: str, title: str, description: str, link: str, url: str, color: tuple[str, str], graphic: str, ) -> rx.Component: return rx.el.div( rx.el.div( rx.el.span(title, class_name="text-slate-12 text-xl font-semibold"), rx.el.span(description, class_name="text-slate-9 text-sm font-medium"), class_name="flex flex-col gap-2 px-10 pt-10", ), rx.el.div( rx.image( src=f"/landing/products/light/product_{graphic}.webp", class_name="w-auto pointer-events-none block dark:hidden", ), rx.image( src=f"/landing/products/dark/product_{graphic}.webp", class_name="w-auto pointer-events-none hidden dark:block", ), class_name="w-full max-h-[17.25rem] h-full overf
import reflex as rx
import reflex as rx
from pcweb.pages.docs import getting_started def product_card( number: int, name: str, title: str, description: str, link: str, url: str, color: tuple[str, str], graphic: str, ) -> rx.Component: return rx.el.div( rx.el.div( rx.el.span(title, class_name="text-slate-12 text-xl font-semibold"), rx.el.span(description, class_name="text-slate-9 text-sm font-medium"), class_name="flex flex-col gap-2 px-10 pt-10", ), rx.el.div( rx.image( src=f"/landing/products/light/product_{graphic}.webp", class_name="w-auto pointer-events-none block dark:hidden", ), rx.image( src=f"/landing/products/dark/product_{graphic}.webp", class_name="w-auto pointer-events-none hidden dark:block", ), class_name="w-full max-h-[17.25rem] h-full overflow-hidden", ), rx.el.a(
from pcweb.components.icons.icons import get_icon
import reflex as rx from pcweb.components.icons.icons import get_icon
def product_card( number: int, name: str, title: str, description: str, link: str, url: str, color: tuple[str, str], graphic: str, ) -> rx.Component: return rx.el.div( rx.el.div( rx.el.span(title, class_name="text-slate-12 text-xl font-semibold"), rx.el.span(description, class_name="text-slate-9 text-sm font-medium"), class_name="flex flex-col gap-2 px-10 pt-10", ), rx.el.div( rx.image( src=f"/landing/products/light/product_{graphic}.webp", class_name="w-auto pointer-events-none block dark:hidden", ), rx.image( src=f"/landing/products/dark/product_{graphic}.webp", class_name="w-auto pointer-events-none hidden dark:block", ), class_name="w-full max-h-[17.25rem] h-full overflow-hidden", ), rx.el.a( rx.el.span( link,
from pcweb.pages.docs import getting_started
def security_badges() -> rx.Component: return rx.box( rx.box( rx.image(src="/soc2.webp", class_name="h-24 w-auto"), rx.image(src="/databricks-partner.svg", class_name="h-24 w-auto"), class_name="flex flex-row gap-10 items-center justify-center", ), class_name="p-10 flex items-center justify-center", ) def security(): return rx.el.section( rx.box( rx.box( rx.el.h2( "Secure by default", class_name="text-slate-12 text-xl lg:text-3xl font-semibold text-start", ), rx.el.h3( "SOC 2 compliant with enterprise-grade security and flexible deployment options.", class_name="text-slate-9 text-lg lg:text-2xl font-semibold text-start", ), class_name="flex flex-col gap-2 lg:col-span-2 p-10 max-lg:border-b border-slate-3", ),
import reflex as rx
import reflex as rx import reflex_ui as ui from pcweb.components.marquee import marquee def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11") def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" ) @dataclass class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025",
from dataclasses import dataclass
from dataclasses import dataclass
import reflex_ui as ui from pcweb.components.marquee import marquee def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11") def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" ) @dataclass class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025", ), Social(
import reflex as rx
from dataclasses import dataclass import reflex as rx
from pcweb.components.marquee import marquee def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11") def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" ) @dataclass class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025", ), Social( name="Alex",
import reflex_ui as ui
from dataclasses import dataclass import reflex as rx import reflex_ui as ui
def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11") def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" ) @dataclass class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025", ), Social( name="Alex", role="OpenSea Co-founder", text=g
from pcweb.components.marquee import marquee
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from pcweb.components.marquee import marquee
def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" ) @dataclass class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025", ), Social( name="Alex", role="OpenSea Co-founder", text=get_normal_text( "Have been playing with ", get_highlight("Reflex"), "
def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11")
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from pcweb.components.marquee import marquee def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11")
@dataclass class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025", ), Social( name="Alex", role="OpenSea Co-founder", text=get_normal_text( "Have been playing with ", get_highlight("Reflex"), " since Jan and realized I should just say, from a fellow YC member: love the architecture decisions you guys are making! ❤️", ), avatar="/landing/socia
def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" )
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from pcweb.components.marquee import marquee def get_highlight(text: str) -> rx.Component: return rx.el.span(text, class_name="text-primary-11") def get_normal_text(*children) -> rx.Component: return rx.el.span( *children, class_name="text-secondary-12 text-sm font-medium text-wrap flex-1" ) @dataclass
SOCIALS_1 = [ Social( name="vishnudeva", role="Data Scientist", text=get_normal_text( "Been a lurker on Hacker News for years but I created an account just so I could say how excited I am! Love the effort you're putting into ", get_highlight("Reflex"), ". Streamlit felt really painful to use whenever you want to do anything slightly out of the main path.", ), url="https://news.ycombinator.com/item?id=35140025", ), Social( name="Alex", role="OpenSea Co-founder", text=get_normal_text( "Have been playing with ", get_highlight("Reflex"), " since Jan and realized I should just say, from a fellow YC member: love the architecture decisions you guys are making! ❤️", ), avatar="/landing/social/alex_opensea.webp", ), Social( name="Andrew", role="Software Engineer", text=get_normal_text( "
class Social: name: str role: str text: str | rx.Component url: str | None = None avatar: str | None = None
.name, class_name="text-secondary-12 font-medium text-sm" ), rx.el.span( social.role, class_name="text-secondary-11 text-sm font-medium" ), class_name="flex flex-col", ), class_name="flex flex-row gap-4 mt-auto", ), rx.fragment( rx.el.a( to=social.url, target="_blank", class_name="absolute inset-0", ), ui.icon( "ArrowUpRight01Icon", class_name="group-hover:opacity-100 opacity-0 scale-50 group-hover:scale-100 transition-all duration-100 absolute bottom-4 right-4 size-5 text-primary-11 origin-bottom-left ease-in-out", ), ) if social.url else None, class_name="flex flex-col gap-4 bg-slate-1 hover:bg-slate-2 transition-colors relative w-[22.5rem] h-[15rem] flex-shrink-0 p-6 group border-slate-4 py-10", )
def social_marquee() -> rx.Component: return rx.el.section( marquee( *[social_card(social) for social in SOCIALS_1], direction="left", ), marquee( *[social_card(social) for social in SOCIALS_2], direction="right", ), class_name="flex flex-col mx-auto w-full max-w-[64.19rem] lg:border-x justify-center items-center relative overflow-hidden border-slate-3 border-b", )
from pcweb.components.icons.icons import get_icon from pcweb.components.numbers_pattern import numbers_pattern from pcweb.constants import GITHUB_STARS def stat(icon: str, text: str) -> rx.Component: return rx.el.section( get_icon(icon, class_name="text-primary-9 [&_svg]:!size-5"), rx.el.span(text, class_name="font-medium text-lg text-slate-12"), class_name="flex flex-row items-center gap-2", ) def social_stats(): return rx.el.section( numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"), numbers_pattern(side="right", reverse=True, class_name="right-0 top-0"), stat("browser", "1M+ Apps Built"), stat("checkmark", "Used by 25% of Fortune 500"), stat("github_navbar", f"{GITHUB_STARS // 1000}K GitHub Stars"), class_name="flex flex-col justify-center items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 relative overflow-hidden border-t gap-4 lg:py-[5rem] py-[3.5rem]
import reflex as rx
import reflex as rx
from pcweb.components.numbers_pattern import numbers_pattern from pcweb.constants import GITHUB_STARS def stat(icon: str, text: str) -> rx.Component: return rx.el.section( get_icon(icon, class_name="text-primary-9 [&_svg]:!size-5"), rx.el.span(text, class_name="font-medium text-lg text-slate-12"), class_name="flex flex-row items-center gap-2", ) def social_stats(): return rx.el.section( numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"), numbers_pattern(side="right", reverse=True, class_name="right-0 top-0"), stat("browser", "1M+ Apps Built"), stat("checkmark", "Used by 25% of Fortune 500"), stat("github_navbar", f"{GITHUB_STARS // 1000}K GitHub Stars"), class_name="flex flex-col justify-center items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 relative overflow-hidden border-t gap-4 lg:py-[5rem] py-[3.5rem] max-lg:border-b", )
from pcweb.components.icons.icons import get_icon
import reflex as rx from pcweb.components.icons.icons import get_icon
from pcweb.constants import GITHUB_STARS def stat(icon: str, text: str) -> rx.Component: return rx.el.section( get_icon(icon, class_name="text-primary-9 [&_svg]:!size-5"), rx.el.span(text, class_name="font-medium text-lg text-slate-12"), class_name="flex flex-row items-center gap-2", ) def social_stats(): return rx.el.section( numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"), numbers_pattern(side="right", reverse=True, class_name="right-0 top-0"), stat("browser", "1M+ Apps Built"), stat("checkmark", "Used by 25% of Fortune 500"), stat("github_navbar", f"{GITHUB_STARS // 1000}K GitHub Stars"), class_name="flex flex-col justify-center items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 relative overflow-hidden border-t gap-4 lg:py-[5rem] py-[3.5rem] max-lg:border-b", )
from pcweb.components.numbers_pattern import numbers_pattern
import reflex as rx from pcweb.components.icons.icons import get_icon from pcweb.components.numbers_pattern import numbers_pattern
def stat(icon: str, text: str) -> rx.Component: return rx.el.section( get_icon(icon, class_name="text-primary-9 [&_svg]:!size-5"), rx.el.span(text, class_name="font-medium text-lg text-slate-12"), class_name="flex flex-row items-center gap-2", ) def social_stats(): return rx.el.section( numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"), numbers_pattern(side="right", reverse=True, class_name="right-0 top-0"), stat("browser", "1M+ Apps Built"), stat("checkmark", "Used by 25% of Fortune 500"), stat("github_navbar", f"{GITHUB_STARS // 1000}K GitHub Stars"), class_name="flex flex-col justify-center items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 relative overflow-hidden border-t gap-4 lg:py-[5rem] py-[3.5rem] max-lg:border-b", )
from pcweb.constants import GITHUB_STARS
from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.new_button import button def start_building() -> rx.Component: return rx.el.section( # Glowing rx.box( class_name="top-[-4.25rem] z-[-1] blur-[28px] absolute rounded-[64.25rem] bg-[radial-gradient(50%_50%_at_50%_50%,_#D4CAFE_0%,_rgba(21,_22,_24,_0)_100%)] dark:bg-[radial-gradient(50%_50%_at_50%_50%,_#4329AC_0%,_rgba(21,_22,_24,_0)_100%)] w-[64.25rem] h-[13rem] overflow-hidden pointer-events-none shrink-0 left-1/2 transform -translate-x-1/2 -translate-y-1/2" ), rx.box( class_name="bottom-[-16.5rem] z-[-1] blur-[28px] absolute rounded-[64.25rem] bg-[radial-gradient(50%_50%_at_50%_50%,_#D4CAFE_0%,_rgba(21,_22,_24,_0)_100%)] dark:bg-[radial-gradient(50%_50%_at_50%_50%,_#4329AC_0%,_rgba(21,_22,_24,_0)_100%)] w-[64.25rem] h-[13rem] overflow-hidden pointer-events-none shrink-0 left-1/2 transform -translate-x-1/2 -translate-y-1/2" ), # Headings
import reflex as rx
import reflex as rx
from pcweb.components.new_button import button def start_building() -> rx.Component: return rx.el.section( # Glowing rx.box( class_name="top-[-4.25rem] z-[-1] blur-[28px] absolute rounded-[64.25rem] bg-[radial-gradient(50%_50%_at_50%_50%,_#D4CAFE_0%,_rgba(21,_22,_24,_0)_100%)] dark:bg-[radial-gradient(50%_50%_at_50%_50%,_#4329AC_0%,_rgba(21,_22,_24,_0)_100%)] w-[64.25rem] h-[13rem] overflow-hidden pointer-events-none shrink-0 left-1/2 transform -translate-x-1/2 -translate-y-1/2" ), rx.box( class_name="bottom-[-16.5rem] z-[-1] blur-[28px] absolute rounded-[64.25rem] bg-[radial-gradient(50%_50%_at_50%_50%,_#D4CAFE_0%,_rgba(21,_22,_24,_0)_100%)] dark:bg-[radial-gradient(50%_50%_at_50%_50%,_#4329AC_0%,_rgba(21,_22,_24,_0)_100%)] w-[64.25rem] h-[13rem] overflow-hidden pointer-events-none shrink-0 left-1/2 transform -translate-x-1/2 -translate-y-1/2" ), # Headings rx.el.h2( "Ready to get start
from reflex_ui.blocks.lemcal import lemcal_dialog
import reflex as rx from reflex_ui.blocks.lemcal import lemcal_dialog
def start_building() -> rx.Component: return rx.el.section( # Glowing rx.box( class_name="top-[-4.25rem] z-[-1] blur-[28px] absolute rounded-[64.25rem] bg-[radial-gradient(50%_50%_at_50%_50%,_#D4CAFE_0%,_rgba(21,_22,_24,_0)_100%)] dark:bg-[radial-gradient(50%_50%_at_50%_50%,_#4329AC_0%,_rgba(21,_22,_24,_0)_100%)] w-[64.25rem] h-[13rem] overflow-hidden pointer-events-none shrink-0 left-1/2 transform -translate-x-1/2 -translate-y-1/2" ), rx.box( class_name="bottom-[-16.5rem] z-[-1] blur-[28px] absolute rounded-[64.25rem] bg-[radial-gradient(50%_50%_at_50%_50%,_#D4CAFE_0%,_rgba(21,_22,_24,_0)_100%)] dark:bg-[radial-gradient(50%_50%_at_50%_50%,_#4329AC_0%,_rgba(21,_22,_24,_0)_100%)] w-[64.25rem] h-[13rem] overflow-hidden pointer-events-none shrink-0 left-1/2 transform -translate-x-1/2 -translate-y-1/2" ), # Headings rx.el.h2( "Ready to get started?", class_name="text-slate-12 text
from pcweb.components.new_button import button
import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.numbers_pattern import numbers_pattern items = [ ("Analytics", "Analytics01Icon"), ("Finance", "CreditCardPosIcon"), ("E-commerce", "ShoppingBasket03Icon"), ("DevOps", "CloudServerIcon"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ] selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
import reflex as rx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar from pcweb.components.numbers_pattern import numbers_pattern items = [ ("Analytics", "Analytics01Icon"), ("Finance", "CreditCardPosIcon"), ("E-commerce", "ShoppingBasket03Icon"), ("DevOps", "CloudServerIcon"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ] selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p(
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern items = [ ("Analytics", "Analytics01Icon"), ("Finance", "CreditCardPosIcon"), ("E-commerce", "ShoppingBasket03Icon"), ("DevOps", "CloudServerIcon"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ] selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", cla
from reflex.experimental.client_state import ClientStateVar
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar
items = [ ("Analytics", "Analytics01Icon"), ("Finance", "CreditCardPosIcon"), ("E-commerce", "ShoppingBasket03Icon"), ("DevOps", "CloudServerIcon"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ] selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-bal
from pcweb.components.numbers_pattern import numbers_pattern
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.numbers_pattern import numbers_pattern
selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def pill_item(name: str, icon: str) -> rx.Component: active_cn = "bg-slate-2 shad
items = [ ("Analytics", "Analytics01Icon"), ("Finance", "CreditCardPosIcon"), ("E-commerce", "ShoppingBasket03Icon"), ("DevOps", "CloudServerIcon"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ]
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.numbers_pattern import numbers_pattern items = [ ("Analytics", "Analytics01Icon"), ("Finance", "CreditCardPosIcon"), ("E-commerce", "ShoppingBasket03Icon"), ("DevOps", "CloudServerIcon"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ]
def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def pill_item(name: str, icon: str) -> rx.Component: active_cn = "bg-slate-2 shadow-large text-slate-12" is_active = selected_industry.value == name return rx.el.div(
selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] )
on"), ("Databases", "Database02Icon"), ("AI Workflows", "MagicWand01Icon"), ] selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", )
def pills() -> rx.Component: return rx.el.div( *[pill_item(name, icon) for name, icon in items], class_name="flex flex-row items-center justify-start border border-slate-4 rounded-lg shadow-small bg-white-1 divide-x divide-slate-4 h-8 mt-10 flex-nowrap overflow-x-auto max-lg:w-full lg:justify-center max-lg:overflow-y-hidden", ) def gradients() -> rx.Component: return rx.fragment( rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="1298" height="728" viewBox="0 0 1298 728" fill="none"> <g opacity="0.48" filter="url(#filter0_f_18264_136883)"> <path d="M176.126 284.172C68.3898 75.0632 -26.8819 15.1277 637.681 128.494C895.881 172.539 1406.87 -42.2487 1155.98 215.019C983.495 391.891 1160.9 306.595 1214 460.374C1234.85 520.772 1258.25 749.789 1005.53 613.288C946.741 581.537 582.142 591.537 386.794 637.841C191.447 684.146 102.392 620.277 74.622 504.517C46.8521 388.756 250.491 428.511 176.126 284.172Z" stroke="#C2B5F5" stroke-wi
def pill_item(name: str, icon: str) -> rx.Component: active_cn = "bg-slate-2 shadow-large text-slate-12" is_active = selected_industry.value == name return rx.el.div( ui.icon(icon), rx.el.span(name), class_name=ui.cn( "h-8 flex flex-row gap-2 items-center px-3 text-slate-9 font-medium text-sm cursor-pointer hover:bg-slate-2 transition-colors text-nowrap", rx.cond(is_active, active_cn, ""), ), on_click=selected_industry.set_value(name), )
lows", "MagicWand01Icon"), ] selected_industry = ClientStateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def pill_item(name: str, icon: str) -> rx.Component:
is_active = selected_industry.value == name return rx.el.div( ui.icon(icon), rx.el.span(name), class_name=ui.cn( "h-8 flex flex-row gap-2 items-center px-3 text-slate-9 font-medium text-sm cursor-pointer hover:bg-slate-2 transition-colors text-nowrap", rx.cond(is_active, active_cn, ""), ), on_click=selected_industry.set_value(name), ) def pills() -> rx.Component: return rx.el.div( *[pill_item(name, icon) for name, icon in items], class_name="flex flex-row items-center justify-start border border-slate-4 rounded-lg shadow-small bg-white-1 divide-x divide-slate-4 h-8 mt-10 flex-nowrap overflow-x-auto max-lg:w-full lg:justify-center max-lg:overflow-y-hidden", ) def gradients() -> rx.Component: return rx.fragment( rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="1298" height="728" viewBox="0 0 1298 728" fill="none"> <g opacity="0.48" filter="url(#filt
active_cn = "bg-slate-2 shadow-large text-slate-12"
StateVar.create( var_name="selected_industry", default=items[0][0] ) def header() -> rx.Component: return rx.el.div( rx.el.div( ui.icon("BrowserIcon", class_name="shrink-0"), rx.el.span("Use Cases", class_name="text-sm font-semibold"), class_name="flex flex-row gap-2 items-center text-primary-9", ), rx.el.h2( "Use Cases by Industry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def pill_item(name: str, icon: str) -> rx.Component: active_cn = "bg-slate-2 shadow-large text-slate-12"
return rx.el.div( ui.icon(icon), rx.el.span(name), class_name=ui.cn( "h-8 flex flex-row gap-2 items-center px-3 text-slate-9 font-medium text-sm cursor-pointer hover:bg-slate-2 transition-colors text-nowrap", rx.cond(is_active, active_cn, ""), ), on_click=selected_industry.set_value(name), ) def pills() -> rx.Component: return rx.el.div( *[pill_item(name, icon) for name, icon in items], class_name="flex flex-row items-center justify-start border border-slate-4 rounded-lg shadow-small bg-white-1 divide-x divide-slate-4 h-8 mt-10 flex-nowrap overflow-x-auto max-lg:w-full lg:justify-center max-lg:overflow-y-hidden", ) def gradients() -> rx.Component: return rx.fragment( rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="1298" height="728" viewBox="0 0 1298 728" fill="none"> <g opacity="0.48" filter="url(#filter0_f_18264_136883)"> <path d="M176.126 284.
is_active = selected_industry.value == name
stry", class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre", ), rx.el.p( "See what’s built with Reflex.", class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre", ), class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden", ) def pill_item(name: str, icon: str) -> rx.Component: active_cn = "bg-slate-2 shadow-large text-slate-12" is_active = selected_industry.value == name return rx.el.div( ui.icon(icon), rx.el.span(name), class_name=ui.cn( "h-8 flex flex-row gap-2 items-center px-3 text-slate-9 font-medium text-sm cursor-pointer hover:bg-slate-2 transition-colors text-nowrap", rx.cond(is_active, active_cn, ""), ), on_click=selected_industry.set_value(name), )
def gradients() -> rx.Component: return rx.fragment( rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="1298" height="728" viewBox="0 0 1298 728" fill="none"> <g opacity="0.48" filter="url(#filter0_f_18264_136883)"> <path d="M176.126 284.172C68.3898 75.0632 -26.8819 15.1277 637.681 128.494C895.881 172.539 1406.87 -42.2487 1155.98 215.019C983.495 391.891 1160.9 306.595 1214 460.374C1234.85 520.772 1258.25 749.789 1005.53 613.288C946.741 581.537 582.142 591.537 386.794 637.841C191.447 684.146 102.392 620.277 74.622 504.517C46.8521 388.756 250.491 428.511 176.126 284.172Z" stroke="#C2B5F5" stroke-width="16"/> </g> <defs> <filter id="filter0_f_18264_136883" x="0" y="0" width="1298" height="728" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviatio
def pills() -> rx.Component: return rx.el.div( *[pill_item(name, icon) for name, icon in items], class_name="flex flex-row items-center justify-start border border-slate-4 rounded-lg shadow-small bg-white-1 divide-x divide-slate-4 h-8 mt-10 flex-nowrap overflow-x-auto max-lg:w-full lg:justify-center max-lg:overflow-y-hidden", )
import reflex_ui as ui from pcweb.components.dialog import dialog from pcweb.constants import LAUNCH_VIDEO_URL, REFLEX_BUILD_URL def video_demo() -> rx.Component: return rx.el.div( dialog( trigger=rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/preview_video.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video roun
import reflex as rx
import reflex as rx
from pcweb.components.dialog import dialog from pcweb.constants import LAUNCH_VIDEO_URL, REFLEX_BUILD_URL def video_demo() -> rx.Component: return rx.el.div( dialog( trigger=rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/preview_video.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video rounded-xl overflow-hidden
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
from pcweb.constants import LAUNCH_VIDEO_URL, REFLEX_BUILD_URL def video_demo() -> rx.Component: return rx.el.div( dialog( trigger=rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/preview_video.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video rounded-xl overflow-hidden cursor-pointer relative isolate group border
from pcweb.components.dialog import dialog
import reflex as rx import reflex_ui as ui from pcweb.components.dialog import dialog
def video_demo() -> rx.Component: return rx.el.div( dialog( trigger=rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/preview_video.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video rounded-xl overflow-hidden cursor-pointer relative isolate group border border-slate-4", ), content=rx.el.div(
from pcweb.constants import LAUNCH_VIDEO_URL, REFLEX_BUILD_URL
from pcweb.components.dialog import dialog from pcweb.components.icons.icons import get_icon from pcweb.components.new_button import button from pcweb.constants import DEMO_VIDEO_URL def icon_svg() -> rx.Component: return rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 16 16" fill="none"> <rect width="16" height="16" rx="2" fill="#6E56CF"/> <path d="M10 9V13H12V9H10Z" fill="white"/> <path d="M4 3V13H6V9H10V7H6V5H10V7H12V3H4Z" fill="white"/> </svg>""", class_name="flex justify-center items-center", ) def video_demo() -> rx.Component: return rx.el.section( rx.box( rx.el.span( rx.box( icon_svg(), rx.el.span( "Reflex Build ", class_name="inline text-slate-12 font-semibold text-2xl", ), class_name="flex flex-row i
import reflex as rx
import reflex as rx
from pcweb.components.icons.icons import get_icon from pcweb.components.new_button import button from pcweb.constants import DEMO_VIDEO_URL def icon_svg() -> rx.Component: return rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 16 16" fill="none"> <rect width="16" height="16" rx="2" fill="#6E56CF"/> <path d="M10 9V13H12V9H10Z" fill="white"/> <path d="M4 3V13H6V9H10V7H6V5H10V7H12V3H4Z" fill="white"/> </svg>""", class_name="flex justify-center items-center", ) def video_demo() -> rx.Component: return rx.el.section( rx.box( rx.el.span( rx.box( icon_svg(), rx.el.span( "Reflex Build ", class_name="inline text-slate-12 font-semibold text-2xl", ), class_name="flex flex-row items-center gap-x-2 justify-center lg:justif
from pcweb.components.dialog import dialog
import reflex as rx from pcweb.components.dialog import dialog
from pcweb.components.new_button import button from pcweb.constants import DEMO_VIDEO_URL def icon_svg() -> rx.Component: return rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 16 16" fill="none"> <rect width="16" height="16" rx="2" fill="#6E56CF"/> <path d="M10 9V13H12V9H10Z" fill="white"/> <path d="M4 3V13H6V9H10V7H6V5H10V7H12V3H4Z" fill="white"/> </svg>""", class_name="flex justify-center items-center", ) def video_demo() -> rx.Component: return rx.el.section( rx.box( rx.el.span( rx.box( icon_svg(), rx.el.span( "Reflex Build ", class_name="inline text-slate-12 font-semibold text-2xl", ), class_name="flex flex-row items-center gap-x-2 justify-center lg:justify-start", ), rx.el
from pcweb.components.icons.icons import get_icon
import reflex as rx from pcweb.components.dialog import dialog from pcweb.components.icons.icons import get_icon
from pcweb.constants import DEMO_VIDEO_URL def icon_svg() -> rx.Component: return rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 16 16" fill="none"> <rect width="16" height="16" rx="2" fill="#6E56CF"/> <path d="M10 9V13H12V9H10Z" fill="white"/> <path d="M4 3V13H6V9H10V7H6V5H10V7H12V3H4Z" fill="white"/> </svg>""", class_name="flex justify-center items-center", ) def video_demo() -> rx.Component: return rx.el.section( rx.box( rx.el.span( rx.box( icon_svg(), rx.el.span( "Reflex Build ", class_name="inline text-slate-12 font-semibold text-2xl", ), class_name="flex flex-row items-center gap-x-2 justify-center lg:justify-start", ), rx.el.span( "The first AI agent
from pcweb.components.new_button import button
import reflex as rx from pcweb.components.dialog import dialog from pcweb.components.icons.icons import get_icon from pcweb.components.new_button import button
def icon_svg() -> rx.Component: return rx.html( """<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 16 16" fill="none"> <rect width="16" height="16" rx="2" fill="#6E56CF"/> <path d="M10 9V13H12V9H10Z" fill="white"/> <path d="M4 3V13H6V9H10V7H6V5H10V7H12V3H4Z" fill="white"/> </svg>""", class_name="flex justify-center items-center", ) def video_demo() -> rx.Component: return rx.el.section( rx.box( rx.el.span( rx.box( icon_svg(), rx.el.span( "Reflex Build ", class_name="inline text-slate-12 font-semibold text-2xl", ), class_name="flex flex-row items-center gap-x-2 justify-center lg:justify-start", ), rx.el.span( "The first AI agent to build internal Python enterprise apps.",
from pcweb.constants import DEMO_VIDEO_URL
bg-[#0000001f] backdrop-blur-[0.1px] rounded-lg", ), class_name="aspect-video rounded-lg overflow-hidden cursor-pointer relative isolate group border border-slate-4", ), content=rx.box( rx.image( "/logo.jpg", class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-10 h-10 z-[-1] rounded-md", ), rx.video( src=DEMO_VIDEO_URL, playing=True, controls=False, class_name="size-full z-[1]", ), class_name="relative isolate aspect-video bg-slate-1 rounded-2xl overflow-hidden", ), class_name="!max-w-[70rem] !p-0 !bg-transparent overflow-hidden", ), class_name="h-full overflow-hidden grid grid-cols-1 lg:grid-cols-2 gap-12 relative isolate items-center md:px-8 py-4 mt-10 scale-90", )
def watch_preview() -> rx.Component: return video_demo()
import reflex as rx LiteralButtonVariant = Literal[ "primary", "secondary", "transparent", "destructive", "outline" ] LiteralButtonSize = Literal["sm", "md", "lg", "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 disabled:!text-slate-8 transition-bg" def get_variant_bg_cn(variant: str) -> str: """Get the background color class name for a button variant. Args: variant (str): The variant of the button. Returns: str: The background color class name. """ return f"enabled:bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-10] hover:to-[--{variant}-9] disabled:hover:bg-[--{variant}-9]" BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = { "size": { "xs": "px-1.5 h-7 rounded-md gap-1.5", "sm": "px-2 h-8 rounded-lg gap-2",
from typing import Any, Dict, Literal, Optional
from typing import Any, Dict, Literal, Optional
LiteralButtonVariant = Literal[ "primary", "secondary", "transparent", "destructive", "outline" ] LiteralButtonSize = Literal["sm", "md", "lg", "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 disabled:!text-slate-8 transition-bg" def get_variant_bg_cn(variant: str) -> str: """Get the background color class name for a button variant. Args: variant (str): The variant of the button. Returns: str: The background color class name. """ return f"enabled:bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-10] hover:to-[--{variant}-9] disabled:hover:bg-[--{variant}-9]" BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = { "size": { "xs": "px-1.5 h-7 rounded-md gap-1.5", "sm": "px-2 h-8 rounded-lg gap-2", "md": "px-2.
import reflex as rx
from typing import Any, Dict, Literal, Optional import reflex as rx
LiteralButtonSize = Literal["sm", "md", "lg", "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 disabled:!text-slate-8 transition-bg" def get_variant_bg_cn(variant: str) -> str: """Get the background color class name for a button variant. Args: variant (str): The variant of the button. Returns: str: The background color class name. """ return f"enabled:bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-10] hover:to-[--{variant}-9] disabled:hover:bg-[--{variant}-9]" BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = { "size": { "xs": "px-1.5 h-7 rounded-md gap-1.5", "sm": "px-2 h-8 rounded-lg gap-2", "md": "px-2.5 h-9 rounded-[10px] gap-2.5", "lg": "px-3 h-10 rounded-xl gap-3", "icon-xs": "size-7 r
LiteralButtonVariant = Literal[ "primary", "secondary", "transparent", "destructive", "outline" ]
from typing import Any, Dict, Literal, Optional import reflex as rx 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" def get_variant_bg_cn(variant: str) -> str: """Get the background color class name for a button variant. Args: variant (str): The variant of the button. Returns: str: The background color class name. """ return f"enabled:bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-10] hover:to-[--{variant}-9] disabled:hover:bg-[--{variant}-9]" BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = { "size": { "xs": "px-1.5 h-7 rounded-md gap-1.5", "sm": "px-2 h-8 rounded-lg gap-2", "md": "px-2.5 h-9 rounded-[10px] gap-2.5", "lg": "px-3 h-10 rounded-xl gap-3", "icon-xs": "size-7 rounded-md", "icon-sm": "size-8 rounded-lg", "icon-md": "size-9
LiteralButtonSize = Literal["sm", "md", "lg", "icon-sm", "icon-md", "icon-lg"]
from typing import Any, Dict, Literal, Optional import reflex as rx LiteralButtonVariant = Literal[ "primary", "secondary", "transparent", "destructive", "outline" ] LiteralButtonSize = Literal["sm", "md", "lg", "icon-sm", "icon-md", "icon-lg"]
def get_variant_bg_cn(variant: str) -> str: """Get the background color class name for a button variant. Args: variant (str): The variant of the button. Returns: str: The background color class name. """ return f"enabled:bg-gradient-to-b from-[--{variant}-9] to-[--{variant}-10] hover:to-[--{variant}-9] disabled:hover:bg-[--{variant}-9]" BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = { "size": { "xs": "px-1.5 h-7 rounded-md gap-1.5", "sm": "px-2 h-8 rounded-lg gap-2", "md": "px-2.5 h-9 rounded-[10px] gap-2.5", "lg": "px-3 h-10 rounded-xl gap-3", "icon-xs": "size-7 rounded-md", "icon-sm": "size-8 rounded-lg", "icon-md": "size-9 rounded-[10px]", "icon-lg": "size-10 rounded-md", }, "variant": { "primary": lambda: f"{get_variant_bg_cn('violet')} text-[#FCFCFD] font-semibold", "secondary": "bg-slate-4 hover:bg-slate-5 text-slate-11 font-semibold",
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"
text: str = "", variant: LiteralButtonVariant = "primary", size: LiteralButtonSize = "sm", style: Dict[str, Any] | None = None, class_name: str = "", icon: Optional[rx.Component] = None, **props, ) -> rx.Component: """Create a button component. Args: text (str): The text to display on the button. variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary". size (LiteralButtonSize, optional): The button size. Defaults to "sm". style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}. class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "". icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None. **props: Additional props to pass to the button element. Returns: rx.Component: A button component with the specified properties. """
variant_class = BUTTON_STYLES["variant"][variant] variant_class = variant_class() if callable(variant_class) else variant_class classes = [ DEFAULT_CLASS_NAME, BUTTON_STYLES["size"][size], variant_class, class_name, ] content = [icon, text] if icon else [text] return rx.el.button( *content, style=style, class_name=" ".join(filter(None, classes)), **props, )
if style is None: style = {}
riant: LiteralButtonVariant = "primary", size: LiteralButtonSize = "sm", style: Dict[str, Any] | None = None, class_name: str = "", icon: Optional[rx.Component] = None, **props, ) -> rx.Component: """Create a button component. Args: text (str): The text to display on the button. variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary". size (LiteralButtonSize, optional): The button size. Defaults to "sm". style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}. class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "". icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None. **props: Additional props to pass to the button element. Returns: rx.Component: A button component with the specified properties. """ if style is None:
variant_class = BUTTON_STYLES["variant"][variant] variant_class = variant_class() if callable(variant_class) else variant_class classes = [ DEFAULT_CLASS_NAME, BUTTON_STYLES["size"][size], variant_class, class_name, ] content = [icon, text] if icon else [text] return rx.el.button( *content, style=style, class_name=" ".join(filter(None, classes)), **props, )
style = {}
uttonVariant = "primary", size: LiteralButtonSize = "sm", style: Dict[str, Any] | None = None, class_name: str = "", icon: Optional[rx.Component] = None, **props, ) -> rx.Component: """Create a button component. Args: text (str): The text to display on the button. variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary". size (LiteralButtonSize, optional): The button size. Defaults to "sm". style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}. class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "". icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None. **props: Additional props to pass to the button element. Returns: rx.Component: A button component with the specified properties. """ if style is None: style = {}
variant_class = variant_class() if callable(variant_class) else variant_class classes = [ DEFAULT_CLASS_NAME, BUTTON_STYLES["size"][size], variant_class, class_name, ] content = [icon, text] if icon else [text] return rx.el.button( *content, style=style, class_name=" ".join(filter(None, classes)), **props, )
variant_class = BUTTON_STYLES["variant"][variant]
= "sm", style: Dict[str, Any] | None = None, class_name: str = "", icon: Optional[rx.Component] = None, **props, ) -> rx.Component: """Create a button component. Args: text (str): The text to display on the button. variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary". size (LiteralButtonSize, optional): The button size. Defaults to "sm". style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}. class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "". icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None. **props: Additional props to pass to the button element. Returns: rx.Component: A button component with the specified properties. """ if style is None: style = {} variant_class = BUTTON_STYLES["variant"][variant]
classes = [ DEFAULT_CLASS_NAME, BUTTON_STYLES["size"][size], variant_class, class_name, ] content = [icon, text] if icon else [text] return rx.el.button( *content, style=style, class_name=" ".join(filter(None, classes)), **props, )
variant_class = variant_class() if callable(variant_class) else variant_class
: Optional[rx.Component] = None, **props, ) -> rx.Component: """Create a button component. Args: text (str): The text to display on the button. variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary". size (LiteralButtonSize, optional): The button size. Defaults to "sm". style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}. class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "". icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None. **props: Additional props to pass to the button element. Returns: rx.Component: A button component with the specified properties. """ if style is None: style = {} variant_class = BUTTON_STYLES["variant"][variant] variant_class = variant_class() if callable(variant_class) else variant_class
content = [icon, text] if icon else [text] return rx.el.button( *content, style=style, class_name=" ".join(filter(None, classes)), **props, )
classes = [ DEFAULT_CLASS_NAME, BUTTON_STYLES["size"][size], variant_class, class_name, ]
he text to display on the button. variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary". size (LiteralButtonSize, optional): The button size. Defaults to "sm". style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}. class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "". icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None. **props: Additional props to pass to the button element. Returns: rx.Component: A button component with the specified properties. """ if style is None: style = {} variant_class = BUTTON_STYLES["variant"][variant] variant_class = variant_class() if callable(variant_class) else variant_class classes = [ DEFAULT_CLASS_NAME, BUTTON_STYLES["size"][size], variant_class, class_name, ]
return rx.el.button( *content, style=style, class_name=" ".join(filter(None, classes)), **props, )
content = [icon, text] if icon else [text]
import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True) CREDITS_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font
import reflex as rx
import reflex as rx
from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True) CREDITS_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True) CREDITS_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-
from reflex.experimental.client_state import ClientStateVar
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs
CREDITS_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4",
collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True)
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True)
CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4", ) def table_row(name:
CREDITS_PER_HOUR_CPU = 0.2
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True) CREDITS_PER_HOUR_CPU = 0.2
COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4", ) def table_row(name: str, cpu: str, ram: str, c
CREDITS_PER_HOUR_GB = 0.5
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True) CREDITS_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5
def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4", ) def table_row(name: str, cpu: str, ram: str, cost: str | rx.Component) -> rx.Component: return rx.box( rx.box( name, class_name="px-2 w-fit text-slate-12 border-slate-6 h-5 rounded-md border justify-start items-center gap-0.5 inline-flex bg-slate-1 text-sm font-medium shrink-0",
COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, }
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from pcweb.components.tabs import tabs collapsed_calculator_cs = ClientStateVar.create("collapsed_calculator", default=True) CREDITS_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, }
def table_row(name: str, cpu: str, ram: str, cost: str | rx.Component) -> rx.Component: return rx.box( rx.box( name, class_name="px-2 w-fit text-slate-12 border-slate-6 h-5 rounded-md border justify-start items-center gap-0.5 inline-flex bg-slate-1 text-sm font-medium shrink-0", ), rx.text(cpu, class_name="font-medium text-sm text-slate-9"), rx.text(ram, class_name="font-medium text-sm text-slate-9"), ( rx.text(cost, class_name="font-medium text-sm text-slate-9 text-end") if isinstance(cost, str) else cost ), class_name="grid grid-cols-4 gap-4 px-6 py-2 border-b border-slate-4 hover:bg-slate-2", ) def learn_more(): return rx.box( rx.el.p( "Learn more about how we calculate ", rx.el.a( "compute costs", href="/docs/hosting/compute", class_name="text-sm font-medium text-slate-10
def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4", )
S_PER_HOUR_CPU = 0.2 CREDITS_PER_HOUR_GB = 0.5 COMPUTE_TABLE = { "c1m.5": {"vcpu": 1, "ram": 0.5}, "c1m1": {"vcpu": 1, "ram": 1}, "c1m2": {"vcpu": 1, "ram": 2}, "c2m2": {"vcpu": 2, "ram": 2}, "c2m4": {"vcpu": 2, "ram": 4}, "c4m4": {"vcpu": 4, "ram": 4}, "c4m8": {"vcpu": 4, "ram": 8}, } def table_header(cost_text: str) -> rx.Component: return rx.box( rx.text("Machine", class_name="text-sm font-semibold text-slate-12"), rx.text("vCPU", class_name="text-sm font-semibold text-slate-12"), rx.text("GB RAM", class_name="text-sm font-semibold text-slate-12"), rx.el.div( ui.icon("TokenCircleIcon", class_name="text-slate-9 size-4"), rx.text( cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4", )
def learn_more(): return rx.box( rx.el.p( "Learn more about how we calculate ", rx.el.a( "compute costs", href="/docs/hosting/compute", class_name="text-sm font-medium text-slate-10 underline", ), " only when your app is being used.", class_name="text-sm font-medium text-slate-9", ), ) def min_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{(specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB) / 60:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 it
def table_row(name: str, cpu: str, ram: str, cost: str | rx.Component) -> rx.Component: return rx.box( rx.box( name, class_name="px-2 w-fit text-slate-12 border-slate-6 h-5 rounded-md border justify-start items-center gap-0.5 inline-flex bg-slate-1 text-sm font-medium shrink-0", ), rx.text(cpu, class_name="font-medium text-sm text-slate-9"), rx.text(ram, class_name="font-medium text-sm text-slate-9"), ( rx.text(cost, class_name="font-medium text-sm text-slate-9 text-end") if isinstance(cost, str) else cost ), class_name="grid grid-cols-4 gap-4 px-6 py-2 border-b border-slate-4 hover:bg-slate-2", )
cost_text, class_name="text-sm font-semibold text-slate-12 text-end" ), class_name="flex flex-row gap-1 items-center justify-end", ), class_name="grid grid-cols-4 gap-4 px-6 py-3 border-b border-slate-4", ) def table_row(name: str, cpu: str, ram: str, cost: str | rx.Component) -> rx.Component: return rx.box( rx.box( name, class_name="px-2 w-fit text-slate-12 border-slate-6 h-5 rounded-md border justify-start items-center gap-0.5 inline-flex bg-slate-1 text-sm font-medium shrink-0", ), rx.text(cpu, class_name="font-medium text-sm text-slate-9"), rx.text(ram, class_name="font-medium text-sm text-slate-9"), ( rx.text(cost, class_name="font-medium text-sm text-slate-9 text-end") if isinstance(cost, str) else cost ), class_name="grid grid-cols-4 gap-4 px-6 py-2 border-b border-slate-4 hover:bg-slate-2", )
def min_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{(specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB) / 60:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", ) def hour_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]),
def learn_more(): return rx.box( rx.el.p( "Learn more about how we calculate ", rx.el.a( "compute costs", href="/docs/hosting/compute", class_name="text-sm font-medium text-slate-10 underline", ), " only when your app is being used.", class_name="text-sm font-medium text-slate-9", ), )
class_name="px-2 w-fit text-slate-12 border-slate-6 h-5 rounded-md border justify-start items-center gap-0.5 inline-flex bg-slate-1 text-sm font-medium shrink-0", ), rx.text(cpu, class_name="font-medium text-sm text-slate-9"), rx.text(ram, class_name="font-medium text-sm text-slate-9"), ( rx.text(cost, class_name="font-medium text-sm text-slate-9 text-end") if isinstance(cost, str) else cost ), class_name="grid grid-cols-4 gap-4 px-6 py-2 border-b border-slate-4 hover:bg-slate-2", ) def learn_more(): return rx.box( rx.el.p( "Learn more about how we calculate ", rx.el.a( "compute costs", href="/docs/hosting/compute", class_name="text-sm font-medium text-slate-10 underline", ), " only when your app is being used.", class_name="text-sm font-medium text-slate-9", ), )
def hour_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", ) def month_table(cost_text: str) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span(
def min_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{(specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB) / 60:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", )
, href="/docs/hosting/compute", class_name="text-sm font-medium text-slate-10 underline", ), " only when your app is being used.", class_name="text-sm font-medium text-slate-9", ), ) def min_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{(specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB) / 60:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", )
def month_table(cost_text: str) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", ) def compute_table() -> rx.Component: return rx.box( tabs.root( rx.box( learn_more(), tabs.list( tabs.tab( "Per min", value="min", ),
def hour_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", )
font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", ) def hour_table(cost_text: str, description: bool = False) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", )
def compute_table() -> rx.Component: return rx.box( tabs.root( rx.box( learn_more(), tabs.list( tabs.tab( "Per min", value="min", ), tabs.tab( "Per hour", value="hour", ), tabs.indicator(), ), class_name="flex flex-col lg:flex-row gap-4 items-center justify-center lg:justify-between p-6 border-b border-slate-4", ), tabs.panel( min_table("Credits / min", description=True), value="min", ), tabs.panel( hour_table("Credits / hour", description=True), value="hour", ), default_value="min", ), class_name="flex flex-col w-full relative data-[collapsed=true]:max-h
def month_table(cost_text: str) -> rx.Component: return rx.box( table_header(cost_text), *[ table_row( name, str(specs["vcpu"]), str(specs["ram"]), rx.el.span( rx.el.span( f"{specs['vcpu'] * CREDITS_PER_HOUR_CPU + specs['ram'] * CREDITS_PER_HOUR_GB:.3f}", class_name="font-medium text-sm text-slate-9", ), class_name="flex flex-row gap-1 items-center justify-end", ), ) for name, specs in COMPUTE_TABLE.items() ], class_name="w-full", )