instruction
stringlengths
0
1k
input
stringlengths
1
1k
output
stringlengths
10
6.51k
"""UI and logic inkeep chat component.""" import reflex as rx
from reflex.vars import Var class InkeepSearchBar(rx.NoSSRComponent): tag = "InkeepSearchBar" library = "@inkeep/cxkit-react@0.5.55" class Search(rx.el.Div): def add_imports(self): """Add the imports for the component.""" return { "react": {ImportVar(tag="useContext")}, "$/utils/context": {ImportVar(tag="ColorModeContext")}, } def add_hooks(self): """Add the hooks for the component.""" return [ "const { resolvedColorMode } = useContext(ColorModeContext)", """ const escalationParams = { type: "object", properties: { explanation: { type: "string", description: "A brief few word justification of why a specific confidence level was chosen.", }, answerConfidence: { anyOf: [ { type: "string", const: "very_confident", description: `\n The AI Assistant provided a complete and direct answer to all parts of the Us
from reflex.utils.imports import ImportVar
"""UI and logic inkeep chat component.""" import reflex as rx from reflex.utils.imports import ImportVar
class InkeepSearchBar(rx.NoSSRComponent): tag = "InkeepSearchBar" library = "@inkeep/cxkit-react@0.5.55" class Search(rx.el.Div): def add_imports(self): """Add the imports for the component.""" return { "react": {ImportVar(tag="useContext")}, "$/utils/context": {ImportVar(tag="ColorModeContext")}, } def add_hooks(self): """Add the hooks for the component.""" return [ "const { resolvedColorMode } = useContext(ColorModeContext)", """ const escalationParams = { type: "object", properties: { explanation: { type: "string", description: "A brief few word justification of why a specific confidence level was chosen.", }, answerConfidence: { anyOf: [ { type: "string", const: "very_confident", description: `\n The AI Assistant provided a complete and direct answer to all parts of the User Question.\n The answer
from reflex.vars import Var
"""UI and logic inkeep chat component.""" import reflex as rx from reflex.utils.imports import ImportVar from reflex.vars import Var
class Search(rx.el.Div): def add_imports(self): """Add the imports for the component.""" return { "react": {ImportVar(tag="useContext")}, "$/utils/context": {ImportVar(tag="ColorModeContext")}, } def add_hooks(self): """Add the hooks for the component.""" return [ "const { resolvedColorMode } = useContext(ColorModeContext)", """ const escalationParams = { type: "object", properties: { explanation: { type: "string", description: "A brief few word justification of why a specific confidence level was chosen.", }, answerConfidence: { anyOf: [ { type: "string", const: "very_confident", description: `\n The AI Assistant provided a complete and direct answer to all parts of the User Question.\n The answer fully resolved the issue without requiring any further action from the User.\n Every part of the answer was cit
class InkeepSearchBar(rx.NoSSRComponent): tag = "InkeepSearchBar" library = "@inkeep/cxkit-react@0.5.55"
"""UI and logic inkeep chat component.""" import reflex as rx from reflex.utils.imports import ImportVar from reflex.vars import Var class InkeepSearchBar(rx.NoSSRComponent):
library = "@inkeep/cxkit-react@0.5.55" class Search(rx.el.Div): def add_imports(self): """Add the imports for the component.""" return { "react": {ImportVar(tag="useContext")}, "$/utils/context": {ImportVar(tag="ColorModeContext")}, } def add_hooks(self): """Add the hooks for the component.""" return [ "const { resolvedColorMode } = useContext(ColorModeContext)", """ const escalationParams = { type: "object", properties: { explanation: { type: "string", description: "A brief few word justification of why a specific confidence level was chosen.", }, answerConfidence: { anyOf: [ { type: "string", const: "very_confident", description: `\n The AI Assistant provided a complete and direct answer to all parts of the User Question.\n The answer fully resolved the issue without requiring any further action from the
tag = "InkeepSearchBar"
"""UI and logic inkeep chat component.""" import reflex as rx from reflex.utils.imports import ImportVar from reflex.vars import Var class InkeepSearchBar(rx.NoSSRComponent): tag = "InkeepSearchBar"
class Search(rx.el.Div): def add_imports(self): """Add the imports for the component.""" return { "react": {ImportVar(tag="useContext")}, "$/utils/context": {ImportVar(tag="ColorModeContext")}, } def add_hooks(self): """Add the hooks for the component.""" return [ "const { resolvedColorMode } = useContext(ColorModeContext)", """ const escalationParams = { type: "object", properties: { explanation: { type: "string", description: "A brief few word justification of why a specific confidence level was chosen.", }, answerConfidence: { anyOf: [ { type: "string", const: "very_confident", description: `\n The AI Assistant provided a complete and direct answer to all parts of the User Question.\n The answer fully resolved the issue without requiring any further action from the User.\n Every part of the answer was cit
library = "@inkeep/cxkit-react@0.5.55"
"""UI and logic inkeep chat component.""" import reflex as rx from reflex.utils.imports import ImportVar from reflex.vars import Var class InkeepSearchBar(rx.NoSSRComponent): tag = "InkeepSearchBar" library = "@inkeep/cxkit-react@0.5.55" class Search(rx.el.Div):
def add_hooks(self): """Add the hooks for the component.""" return [ "const { resolvedColorMode } = useContext(ColorModeContext)", """ const escalationParams = { type: "object", properties: { explanation: { type: "string", description: "A brief few word justification of why a specific confidence level was chosen.", }, answerConfidence: { anyOf: [ { type: "string", const: "very_confident", description: `\n The AI Assistant provided a complete and direct answer to all parts of the User Question.\n The answer fully resolved the issue without requiring any further action from the User.\n Every part of the answer was cited from the information sources.\n The assistant did not ask for more information or provide options requiring User action.\n This is the highest Answer Confidence level and should be used sparingly.\n `, }, { type: "
def add_imports(self): """Add the imports for the component.""" return { "react": {ImportVar(tag="useContext")}, "$/utils/context": {ImportVar(tag="ColorModeContext")}, }
placeholder: 'Search', }, aiChatSettings: { // optional typeof InkeepAIChatSettings exampleQuestions: [ 'How does Reflex work?', 'What types of apps can I build with Reflex?', 'Where can I deploy my apps?', ], getTools: () => [ { type: "function", function: { name: "provideAnswerConfidence", description: "Determine how confident the AI assistant was and whether or not to escalate to humans.", parameters: escalationParams, }, renderMessageButtons: ({ args }) => { const confidence = args.answerConfidence; if (["not_confident", "no_sources", "other"].includes(confidence)) { return [ { label: "Contact Support", action: { 'type': 'open_form', }, } ]; } return []; }, }, ], }, };""", ] @classmethod
inkeep = Search.create
def create(cls): """Create the search component.""" return super().create( InkeepSearchBar.create( special_props=[Var("{...searchBarProps}")], ) )
I deploy my apps?', ], getTools: () => [ { type: "function", function: { name: "provideAnswerConfidence", description: "Determine how confident the AI assistant was and whether or not to escalate to humans.", parameters: escalationParams, }, renderMessageButtons: ({ args }) => { const confidence = args.answerConfidence; if (["not_confident", "no_sources", "other"].includes(confidence)) { return [ { label: "Contact Support", action: { 'type': 'open_form', }, } ]; } return []; }, }, ], }, };""", ] @classmethod def create(cls): """Create the search component.""" return super().create( InkeepSearchBar.create( special_props=[Var("{...searchBarProps}")], ) )
inkeep = Search.create
"""UI and logic for the navbar component."""
import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text,
import reflex as rx
"""UI and logic for the navbar component.""" import reflex as rx
from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small
import reflex_ui as ui
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui
from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]",
from reflex_ui.blocks.lemcal import lemcal_dialog
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog
from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron
from pcweb.components.hosting_banner import hosting_banner
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner
from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=
from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL
from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex
from pcweb.pages.blog import blogs
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs
from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto",
from pcweb.pages.blog.paths import blog_data
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data
from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap item
from pcweb.pages.docs import ai_builder, getting_started
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started
from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondar
from pcweb.pages.faq import faq
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq
from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-co
from pcweb.pages.framework.framework import framework
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework
from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-
from pcweb.pages.hosting.hosting import hosting_landing
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing
from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=Sid
from pcweb.pages.use_cases.use_cases import use_cases_page
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page
from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) d
from ...link_button import resources_button
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button
from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, a
from ..sidebar import SidebarState
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState
from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path
from .buttons.discord import discord
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord
from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path u
from .buttons.github import github
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github
from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/
from .buttons.sidebar import navbar_sidebar_button
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button
def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_pat
from .search import search_bar
"""UI and logic for the navbar component.""" import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import hosting_banner from pcweb.constants import REFLEX_BUILD_URL, REFLEX_CLOUD_URL from pcweb.pages.blog import blogs from pcweb.pages.blog.paths import blog_data from pcweb.pages.docs import ai_builder, getting_started from pcweb.pages.faq import faq from pcweb.pages.framework.framework import framework from pcweb.pages.hosting.hosting import hosting_landing from pcweb.pages.use_cases.use_cases import use_cases_page from ...link_button import resources_button from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar
def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (fo
def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), )
n from ..sidebar import SidebarState from .buttons.discord import discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), )
def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right", size=14, class_name="!text-slate-8"), class_name="flex flex-row justify-between items-center w-full", ), class_name="flex flex-col items-start gap-1 hover:bg-slate-3 px-3.5 py-[1.125rem] rounded-md w-full transition-bg self-stretch", ), class_name="w-full", underline="none", href=url, ) def blog_section() -> rx.Component: return ui.navigation_menu.content( rx.box(
def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), )
ort discord from .buttons.github import github from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""):
url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_sour
router_path = rx.State.router.page.path
b from .buttons.sidebar import navbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path
if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("o
url = url.rstrip("/") + "/"
vbar_sidebar_button from .search import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/"
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
ch import search_bar def resource_item(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/":
is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud")
is_home = router_path == "/"
tem(text: str, url: str, icon: str, index): return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/"
not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not
is_docs = router_path.contains("docs")
return rx.el.a( rx.box( ui.icon(icon, size=16, class_name="flex-shrink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs")
not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud
not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting"))
rink-0 text-slate-9"), rx.text( text, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting"))
active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str
not_ai_builder = ~router_path.contains("ai-builder")
xt, class_name="font-small text-slate-9 truncate text-start w-[150px]", ), rx.icon( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder")
elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs")
active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) )
con( tag="chevron_right", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) )
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
t", size=14, stroke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder":
elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else:
active = router_path.contains("ai-builder")
ke_width=2, class_name="flex-shrink-0 text-slate-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder")
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
e-8 ml-auto", ), class_name="flex flex-row flex-nowrap items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud":
elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-s
active = router_path.contains("cloud") | router_path.contains("hosting")
items-center gap-4 hover:bg-secondary-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting")
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
-3 px-[1.125rem] py-2 rounded-md w-full transition-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing":
elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-vi
active = router_path.contains("pricing")
tion-colors", ), class_name="w-full text-slate-9 hover:text-slate-9", to=url, on_click=SidebarState.set_sidebar_index(index), ) def link_item(name: str, url: str, active_str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing")
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
str: str = ""): router_path = rx.State.router.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page)
is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0),
is_docs = router_path.contains("docs")
er.page.path url = url.rstrip("/") + "/" if active_str == "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs")
not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) ->
is_open_source_page = router_path.contains("open-source")
= "/": is_home = router_path == "/" is_docs = router_path.contains("docs") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source")
not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment(
not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting"))
s") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting"))
active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY",
not_ai_builder = ~router_path.contains("ai-builder")
ter_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder")
elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading
active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page
s("ai-builder") active = rx.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
x.cond( is_home, True, rx.cond(is_docs & not_cloud & not_ai_builder, True, False) ) elif active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs":
elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_
active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") )
active_str == "builder": active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") )
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
elif active_str: active = router_path.contains(active_str) else: active = False
active = router_path.contains("ai-builder") elif active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str:
else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ),
active = router_path.contains(active_str)
if active_str == "hosting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else:
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right",
active = False
sting" or active_str == "cloud": active = router_path.contains("cloud") | router_path.contains("hosting") elif active_str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False
active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right", size=14, class_name="!text-slate-8"), class_name="flex flex-row justify-between items-center w-full", )
common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 "
str == "pricing": active = router_path.contains("pricing") elif active_str == "framework": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 "
unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right", size=14, class_name="!text-slate-8"), class_name="flex flex-row justify-between items-center w-full", ), class_name="flex flex-col items-start gap-1 hover:bg-slate-3 px-3.5 py-[1.125rem] ro
active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9"
ork": # Check if path contains "docs" but excludes ai-builder, cloud, and hosting # OR if path contains "open-source" (for the main open source landing page) is_docs = router_path.contains("docs") is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9"
return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), ) def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right", size=14, class_name="!text-slate-8"), class_name="flex flex-row justify-between items-center w-full", ), class_name="flex flex-col items-start gap-1 hover:bg-slate-3 px-3.5 py-[1.125rem] rounded-md w-full transition-bg self-stretch",
unactive_cn = "shadow-none text-secondary-11"
is_open_source_page = router_path.contains("open-source") not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting")) not_ai_builder = ~router_path.contains("ai-builder") active = (is_docs & not_cloud & not_ai_builder) | is_open_source_page elif active_str == "docs": active = rx.cond( router_path.contains("library"), False, router_path.contains("docs") ) elif active_str: active = router_path.contains(active_str) else: active = False common_cn = "transition-color p-[1.406rem_0px] font-small xl:flex hidden items-center justify-center hover:text-secondary-12 " active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 hover:text-violet-9" unactive_cn = "shadow-none text-secondary-11" return rx.el.a( name, to=url, class_name=common_cn + rx.cond(active, active_cn, unactive_cn), on_click=SidebarState.set_sidebar_index(0), )
def blog_section() -> rx.Component: return ui.navigation_menu.content( rx.box( rx.link( rx.moment( str(next(iter(blog_data.values())).metadata["date"]), format="MMM DD, YYYY", class_name="z-[2] pt-[0.875rem] pl-[1.125rem] font-instrument-sans font-medium text-[0.8125rem] text-white truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.spacer(), rx.box( rx.text( next(iter(blog_data.values())).metadata["title"], class_name="font-base text-white truncate self-start", ), rx.box( rx.icon( tag="chevron-right", size=14, class_name="text-white", ), align_items="center",
def blog_section_item(date: str, title: str, url: str) -> rx.Component: return rx.link( rx.box( rx.moment( date, format="MMM DD, YYYY", class_name="font-medium font-size-[0.8125rem] text-slate-9 truncate leading-[1.25rem] tracking-[-0.01013rem]", ), rx.box( rx.text( title, class_name="font-base text-slate-11 truncate", ), rx.icon(tag="chevron-right", size=14, class_name="!text-slate-8"), class_name="flex flex-row justify-between items-center w-full", ), class_name="flex flex-col items-start gap-1 hover:bg-slate-3 px-3.5 py-[1.125rem] rounded-md w-full transition-bg self-stretch", ), class_name="w-full", underline="none", href=url, )
w justify-between gap-3 hover:bg-slate-3 px-[1.125rem] py-3 rounded-md w-full text-nowrap transition-bg self-stretch", ), class_name="w-full", underline="none", href=blogs.path, ), blog_section_item( date=str(list(blog_data.values())[1].metadata["date"]), title=list(blog_data.values())[1].metadata["title"], url="/" + list(blog_data.keys())[1].replace("/docs/", ""), ), blog_section_item( date=str(list(blog_data.values())[2].metadata["date"]), title=list(blog_data.values())[2].metadata["title"], url="/" + list(blog_data.keys())[2], ), class_name="flex flex-col items-start gap-1.5 w-full", ), class_name="flex flex-row items-start gap-1.5 p-1.5 w-[610px]", ), )
def grid_card( title: str, description: str, url: str, image: str, image_style: str ) -> rx.Component: return rx.el.a( rx.box( rx.text(title, class_name="text-slate-12 text-base font-semibold"), rx.el.button( rx.icon("chevron-right", class_name="text-slate-9 size-4"), class_name="size-6 group-hover:bg-secondary-3 transition-colors rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), rx.image( src=image, class_name=image_style, ), to=url, class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[16.5625rem] overflow-hidden group", ) def grid_card_unique(title: str, description: str, url: str, component) -> rx.Com
def link_button(label: str, url: str) -> rx.Component: return rx.el.a( resources_button( label, size="md", variant="transparent", class_name="justify-start w-full" ), to=url, target="_blank", underline="none", class_name="!w-full", )
n_item( date=str(list(blog_data.values())[1].metadata["date"]), title=list(blog_data.values())[1].metadata["title"], url="/" + list(blog_data.keys())[1].replace("/docs/", ""), ), blog_section_item( date=str(list(blog_data.values())[2].metadata["date"]), title=list(blog_data.values())[2].metadata["title"], url="/" + list(blog_data.keys())[2], ), class_name="flex flex-col items-start gap-1.5 w-full", ), class_name="flex flex-row items-start gap-1.5 p-1.5 w-[610px]", ), ) def link_button(label: str, url: str) -> rx.Component: return rx.el.a( resources_button( label, size="md", variant="transparent", class_name="justify-start w-full" ), to=url, target="_blank", underline="none", class_name="!w-full", )
def grid_card_unique(title: str, description: str, url: str, component) -> rx.Component: return rx.link( rx.box( rx.text(title, class_name="text-slate-12 text-base font-semibold"), rx.el.button( rx.icon("chevron-right", class_name="text-slate-9 size-4"), class_name="size-6 group-hover:bg-slate-3 transition-bg rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), component, href=url, is_external=True, underline="none", class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[14.5625rem] overflow-hidden group", ) # def new_resource_section(): _company_items = [ { "label": "Newsletter", "url": "http
def grid_card( title: str, description: str, url: str, image: str, image_style: str ) -> rx.Component: return rx.el.a( rx.box( rx.text(title, class_name="text-slate-12 text-base font-semibold"), rx.el.button( rx.icon("chevron-right", class_name="text-slate-9 size-4"), class_name="size-6 group-hover:bg-secondary-3 transition-colors rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), rx.image( src=image, class_name=image_style, ), to=url, class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[16.5625rem] overflow-hidden group", )
target="_blank", underline="none", class_name="!w-full", ) def grid_card( title: str, description: str, url: str, image: str, image_style: str ) -> rx.Component: return rx.el.a( rx.box( rx.text(title, class_name="text-slate-12 text-base font-semibold"), rx.el.button( rx.icon("chevron-right", class_name="text-slate-9 size-4"), class_name="size-6 group-hover:bg-secondary-3 transition-colors rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), rx.image( src=image, class_name=image_style, ), to=url, class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[16.5625rem] overflow-hidden group", )
# def new_resource_section(): _company_items = [ { "label": "Newsletter", "url": "https://reflex.dev/open-source/#newsletter", "icon": "MailAtSign01Icon", }, {"label": "Blog", "url": "/blog", "icon": "RightToLeftListDashIcon"}, {"label": "Affiliates", "url": "/affiliates", "icon": "AddTeamIcon"}, {"label": "Use Cases", "url": use_cases_page.path, "icon": "CheckListIcon"}, ] _open_source_items = [ {"label": "Templates", "url": "/templates", "icon": "SidebarTopIcon"}, { "label": "Changelog", "url": "https://github.com/reflex-dev/reflex/releases", "icon": "Clock02Icon", }, { "label": "Contributing", "url": "https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md", "icon": "SourceCodeIcon", }, { "label": "Discussions", "url": "https://github.com/orgs/
def grid_card_unique(title: str, description: str, url: str, component) -> rx.Component: return rx.link( rx.box( rx.text(title, class_name="text-slate-12 text-base font-semibold"), rx.el.button( rx.icon("chevron-right", class_name="text-slate-9 size-4"), class_name="size-6 group-hover:bg-slate-3 transition-bg rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), component, href=url, is_external=True, underline="none", class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[14.5625rem] overflow-hidden group", )
x flex-col gap-3 p-5 relative border-solid !h-[16.5625rem] overflow-hidden group", ) def grid_card_unique(title: str, description: str, url: str, component) -> rx.Component: return rx.link( rx.box( rx.text(title, class_name="text-slate-12 text-base font-semibold"), rx.el.button( rx.icon("chevron-right", class_name="text-slate-9 size-4"), class_name="size-6 group-hover:bg-slate-3 transition-bg rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), component, href=url, is_external=True, underline="none", class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[14.5625rem] overflow-hidden group", ) # def new_resource_section():
_open_source_items = [ {"label": "Templates", "url": "/templates", "icon": "SidebarTopIcon"}, { "label": "Changelog", "url": "https://github.com/reflex-dev/reflex/releases", "icon": "Clock02Icon", }, { "label": "Contributing", "url": "https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md", "icon": "SourceCodeIcon", }, { "label": "Discussions", "url": "https://github.com/orgs/reflex-dev/discussions", "icon": "Message01Icon", }, { "label": "FAQ", "url": faq.path, "icon": "HelpCircleIcon", }, ] def _link_button(label: str, url: str, icon: str) -> rx.Component: return rx.el.a( resources_button( ui.icon(icon, size=16, class_name="flex-shrink-0"), label, size="md", variant=
_company_items = [ { "label": "Newsletter", "url": "https://reflex.dev/open-source/#newsletter", "icon": "MailAtSign01Icon", }, {"label": "Blog", "url": "/blog", "icon": "RightToLeftListDashIcon"}, {"label": "Affiliates", "url": "/affiliates", "icon": "AddTeamIcon"}, {"label": "Use Cases", "url": use_cases_page.path, "icon": "CheckListIcon"}, ]
group-hover:bg-slate-3 transition-bg rounded-md flex items-center justify-center", ), class_name="flex flex-row items-center gap-2 justify-between", ), rx.text(description, class_name="text-slate-9 text-sm font-medium"), component, href=url, is_external=True, underline="none", class_name="w-[14.5rem] rounded-md shadow-small bg-white-1 border border-slate-4 flex flex-col gap-3 p-5 relative border-solid !h-[14.5625rem] overflow-hidden group", ) # def new_resource_section(): _company_items = [ { "label": "Newsletter", "url": "https://reflex.dev/open-source/#newsletter", "icon": "MailAtSign01Icon", }, {"label": "Blog", "url": "/blog", "icon": "RightToLeftListDashIcon"}, {"label": "Affiliates", "url": "/affiliates", "icon": "AddTeamIcon"}, {"label": "Use Cases", "url": use_cases_page.path, "icon": "CheckListIcon"}, ]
def _link_button(label: str, url: str, icon: str) -> rx.Component: return rx.el.a( resources_button( ui.icon(icon, size=16, class_name="flex-shrink-0"), label, size="md", variant="transparent", class_name="justify-start w-full items-center gap-3", ), to=url, class_name="w-full", ) def _resource_section_column( section_title: str, resource_item: list[dict[str, str]] ): return rx.box( rx.box( rx.text( section_title, class_name="text-sm text-slate-12 font-semibold px-2.5 py-1 pb-2", ), *[ _link_button(item["label"], item["url"], item["icon"]) for item in resource_item ], class_name="flex flex-col w-full p-2", ), class_name="
_open_source_items = [ {"label": "Templates", "url": "/templates", "icon": "SidebarTopIcon"}, { "label": "Changelog", "url": "https://github.com/reflex-dev/reflex/releases", "icon": "Clock02Icon", }, { "label": "Contributing", "url": "https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md", "icon": "SourceCodeIcon", }, { "label": "Discussions", "url": "https://github.com/orgs/reflex-dev/discussions", "icon": "Message01Icon", }, { "label": "FAQ", "url": faq.path, "icon": "HelpCircleIcon", }, ]
con", }, {"label": "Blog", "url": "/blog", "icon": "RightToLeftListDashIcon"}, {"label": "Affiliates", "url": "/affiliates", "icon": "AddTeamIcon"}, {"label": "Use Cases", "url": use_cases_page.path, "icon": "CheckListIcon"}, ] _open_source_items = [ {"label": "Templates", "url": "/templates", "icon": "SidebarTopIcon"}, { "label": "Changelog", "url": "https://github.com/reflex-dev/reflex/releases", "icon": "Clock02Icon", }, { "label": "Contributing", "url": "https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md", "icon": "SourceCodeIcon", }, { "label": "Discussions", "url": "https://github.com/orgs/reflex-dev/discussions", "icon": "Message01Icon", }, { "label": "FAQ", "url": faq.path, "icon": "HelpCircleIcon", }, ]
def _resource_section_column( section_title: str, resource_item: list[dict[str, str]] ): return rx.box( rx.box( rx.text( section_title, class_name="text-sm text-slate-12 font-semibold px-2.5 py-1 pb-2", ), *[ _link_button(item["label"], item["url"], item["icon"]) for item in resource_item ], class_name="flex flex-col w-full p-2", ), class_name="flex flex-col w-full max-w-[9.1875rem]", ) return ui.navigation_menu.content( _resource_section_column("Open Source", _open_source_items), _resource_section_column("Company", _company_items), # Grid cards rx.box( grid_card( "Customers", "Meet the teams who chose Reflex.", "/customers", rx.color_mode_cond(
def _link_button(label: str, url: str, icon: str) -> rx.Component: return rx.el.a( resources_button( ui.icon(icon, size=16, class_name="flex-shrink-0"), label, size="md", variant="transparent", class_name="justify-start w-full items-center gap-3", ), to=url, class_name="w-full", )
": "https://github.com/reflex-dev/reflex/releases", "icon": "Clock02Icon", }, { "label": "Contributing", "url": "https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md", "icon": "SourceCodeIcon", }, { "label": "Discussions", "url": "https://github.com/orgs/reflex-dev/discussions", "icon": "Message01Icon", }, { "label": "FAQ", "url": faq.path, "icon": "HelpCircleIcon", }, ] def _link_button(label: str, url: str, icon: str) -> rx.Component: return rx.el.a( resources_button( ui.icon(icon, size=16, class_name="flex-shrink-0"), label, size="md", variant="transparent", class_name="justify-start w-full items-center gap-3", ), to=url, class_name="w-full", )
return ui.navigation_menu.content( _resource_section_column("Open Source", _open_source_items), _resource_section_column("Company", _company_items), # Grid cards rx.box( grid_card( "Customers", "Meet the teams who chose Reflex.", "/customers", rx.color_mode_cond( "/bayesline_light_landing.png", "/bayesline_dark_landing.png", ), "absolute -bottom-7 rounded-tl-md", ), class_name="grid grid-cols-2 gap-3 p-3 bg-slate-1", ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-row rounded-xl w-[34.55rem] font-sans overflow-hidden p-1.5", ), ) def new_menu_trigger( title: str, url: str | None = None, active_str: str = "" ) -> rx.Component: if url: return ui.navigation_menu.trigg
def _resource_section_column( section_title: str, resource_item: list[dict[str, str]] ): return rx.box( rx.box( rx.text( section_title, class_name="text-sm text-slate-12 font-semibold px-2.5 py-1 pb-2", ), *[ _link_button(item["label"], item["url"], item["icon"]) for item in resource_item ], class_name="flex flex-col w-full p-2", ), class_name="flex flex-col w-full max-w-[9.1875rem]", )
], class_name="flex flex-col w-full p-2", ), class_name="flex flex-col w-full max-w-[9.1875rem]", ) return ui.navigation_menu.content( _resource_section_column("Open Source", _open_source_items), _resource_section_column("Company", _company_items), # Grid cards rx.box( grid_card( "Customers", "Meet the teams who chose Reflex.", "/customers", rx.color_mode_cond( "/bayesline_light_landing.png", "/bayesline_dark_landing.png", ), "absolute -bottom-7 rounded-tl-md", ), class_name="grid grid-cols-2 gap-3 p-3 bg-slate-1", ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-row rounded-xl w-[34.55rem] font-sans overflow-hidden p-1.5", ), )
def logo() -> rx.Component: return rx.el.a( rx.fragment( rx.image( src="/logos/light/reflex.svg", alt="Reflex Logo", class_name="shrink-0 block dark:hidden", ), rx.image( src="/logos/dark/reflex.svg", alt="Reflex Logo", class_name="shrink-0 hidden dark:block", ), ), class_name="block shrink-0 mr-3", to="/", ) def doc_section(): from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.content( resource_item( "AI Builder Docs", ai_builder.overview.best_practices.path, "MagicWand01Icon", 0, ), resource_item( "Open Source Docs", getting_started.introduction.path, "SourceCodeCircleIcon", 0, ), resource_item( "Cloud Docs", hosting
def new_menu_trigger( title: str, url: str | None = None, active_str: str = "" ) -> rx.Component: if url: return ui.navigation_menu.trigger(link_item(title, url, active_str)) return ui.navigation_menu.trigger( rx.box( rx.text( title, class_name="p-[1.406rem_0px] font-medium text-sm text-secondary-11 group-hover:text-secondary-12 transition-colors", ), rx.icon( "chevron-down", class_name="chevron size-5 !text-secondary-11 group-hover:!text-secondary-12 py-1 mr-0 transition-all ease-out", ), class_name="flex-row items-center gap-x-1 group user-select-none cursor-pointer xl:flex hidden", on_click=rx.stop_propagation, ), style={ "&[data-popup-open] .chevron": { "transform": "rotate(180deg)", }, }, unstyled=True, )
x flex-col w-full max-w-[9.1875rem]", ) return ui.navigation_menu.content( _resource_section_column("Open Source", _open_source_items), _resource_section_column("Company", _company_items), # Grid cards rx.box( grid_card( "Customers", "Meet the teams who chose Reflex.", "/customers", rx.color_mode_cond( "/bayesline_light_landing.png", "/bayesline_dark_landing.png", ), "absolute -bottom-7 rounded-tl-md", ), class_name="grid grid-cols-2 gap-3 p-3 bg-slate-1", ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-row rounded-xl w-[34.55rem] font-sans overflow-hidden p-1.5", ), ) def new_menu_trigger( title: str, url: str | None = None, active_str: str = "" ) -> rx.Component:
return ui.navigation_menu.trigger( rx.box( rx.text( title, class_name="p-[1.406rem_0px] font-medium text-sm text-secondary-11 group-hover:text-secondary-12 transition-colors", ), rx.icon( "chevron-down", class_name="chevron size-5 !text-secondary-11 group-hover:!text-secondary-12 py-1 mr-0 transition-all ease-out", ), class_name="flex-row items-center gap-x-1 group user-select-none cursor-pointer xl:flex hidden", on_click=rx.stop_propagation, ), style={ "&[data-popup-open] .chevron": { "transform": "rotate(180deg)", }, }, unstyled=True, ) def logo() -> rx.Component: return rx.el.a( rx.fragment( rx.image( src="/logos/light/reflex.svg", alt="Reflex Logo", class_name="shrink-0 block dark:hidden"
if url: return ui.navigation_menu.trigger(link_item(title, url, active_str))
low-hidden p-1.5", ), ) def new_menu_trigger( title: str, url: str | None = None, active_str: str = "" ) -> rx.Component: if url: return ui.navigation_menu.trigger(link_item(title, url, active_str)) return ui.navigation_menu.trigger( rx.box( rx.text( title, class_name="p-[1.406rem_0px] font-medium text-sm text-secondary-11 group-hover:text-secondary-12 transition-colors", ), rx.icon( "chevron-down", class_name="chevron size-5 !text-secondary-11 group-hover:!text-secondary-12 py-1 mr-0 transition-all ease-out", ), class_name="flex-row items-center gap-x-1 group user-select-none cursor-pointer xl:flex hidden", on_click=rx.stop_propagation, ), style={ "&[data-popup-open] .chevron": { "transform": "rotate(180deg)", }, }, unstyled=True, )
def doc_section(): from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.content( resource_item( "AI Builder Docs", ai_builder.overview.best_practices.path, "MagicWand01Icon", 0, ), resource_item( "Open Source Docs", getting_started.introduction.path, "SourceCodeCircleIcon", 0, ), resource_item( "Cloud Docs", hosting_page.deploy_quick_start.path, "CloudServerIcon", 0 ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-col gap-1.5 m-0 p-1.5 w-[280px] min-w-max h-auto", ), ) def new_component_section() -> rx.Component: from pcweb.pages.docs import ai_builder as ai_builder_pages from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.root( ui.navigation_menu.list(
def logo() -> rx.Component: return rx.el.a( rx.fragment( rx.image( src="/logos/light/reflex.svg", alt="Reflex Logo", class_name="shrink-0 block dark:hidden", ), rx.image( src="/logos/dark/reflex.svg", alt="Reflex Logo", class_name="shrink-0 hidden dark:block", ), ), class_name="block shrink-0 mr-3", to="/", )
"chevron-down", class_name="chevron size-5 !text-secondary-11 group-hover:!text-secondary-12 py-1 mr-0 transition-all ease-out", ), class_name="flex-row items-center gap-x-1 group user-select-none cursor-pointer xl:flex hidden", on_click=rx.stop_propagation, ), style={ "&[data-popup-open] .chevron": { "transform": "rotate(180deg)", }, }, unstyled=True, ) def logo() -> rx.Component: return rx.el.a( rx.fragment( rx.image( src="/logos/light/reflex.svg", alt="Reflex Logo", class_name="shrink-0 block dark:hidden", ), rx.image( src="/logos/dark/reflex.svg", alt="Reflex Logo", class_name="shrink-0 hidden dark:block", ), ), class_name="block shrink-0 mr-3", to="/", )
def new_component_section() -> rx.Component: from pcweb.pages.docs import ai_builder as ai_builder_pages from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.root( ui.navigation_menu.list( ui.navigation_menu.item( rx.box( logo(), rx.badge( "Docs", variant="surface", class_name=( "text-violet-9 text-sm " + rx.cond( rx.State.router.page.path.contains("docs") | rx.State.router.page.path.contains("ai-builder") | rx.State.router.page.path.contains("cloud"), "hidden lg:flex", "hidden", ) ), ), class_nam
def doc_section(): from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.content( resource_item( "AI Builder Docs", ai_builder.overview.best_practices.path, "MagicWand01Icon", 0, ), resource_item( "Open Source Docs", getting_started.introduction.path, "SourceCodeCircleIcon", 0, ), resource_item( "Cloud Docs", hosting_page.deploy_quick_start.path, "CloudServerIcon", 0 ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-col gap-1.5 m-0 p-1.5 w-[280px] min-w-max h-auto", ), )
n-down", class_name="chevron size-5 !text-secondary-11 group-hover:!text-secondary-12 py-1 mr-0 transition-all ease-out", ), class_name="flex-row items-center gap-x-1 group user-select-none cursor-pointer xl:flex hidden", on_click=rx.stop_propagation, ), style={ "&[data-popup-open] .chevron": { "transform": "rotate(180deg)", }, }, unstyled=True, ) def logo() -> rx.Component: return rx.el.a( rx.fragment( rx.image( src="/logos/light/reflex.svg", alt="Reflex Logo", class_name="shrink-0 block dark:hidden", ), rx.image( src="/logos/dark/reflex.svg", alt="Reflex Logo", class_name="shrink-0 hidden dark:block", ), ), class_name="block shrink-0 mr-3", to="/", ) def doc_section():
return ui.navigation_menu.content( resource_item( "AI Builder Docs", ai_builder.overview.best_practices.path, "MagicWand01Icon", 0, ), resource_item( "Open Source Docs", getting_started.introduction.path, "SourceCodeCircleIcon", 0, ), resource_item( "Cloud Docs", hosting_page.deploy_quick_start.path, "CloudServerIcon", 0 ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-col gap-1.5 m-0 p-1.5 w-[280px] min-w-max h-auto", ), ) def new_component_section() -> rx.Component: from pcweb.pages.docs import ai_builder as ai_builder_pages from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.root( ui.navigation_menu.list( ui.navigation_menu.item( rx.box( l
from pcweb.pages.docs import hosting as hosting_page
lex.svg", alt="Reflex Logo", class_name="shrink-0 hidden dark:block", ), ), class_name="block shrink-0 mr-3", to="/", ) def doc_section(): from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.content( resource_item( "AI Builder Docs", ai_builder.overview.best_practices.path, "MagicWand01Icon", 0, ), resource_item( "Open Source Docs", getting_started.introduction.path, "SourceCodeCircleIcon", 0, ), resource_item( "Cloud Docs", hosting_page.deploy_quick_start.path, "CloudServerIcon", 0 ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-col gap-1.5 m-0 p-1.5 w-[280px] min-w-max h-auto", ), ) def new_component_section() -> rx.Component:
from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.root( ui.navigation_menu.list( ui.navigation_menu.item( rx.box( logo(), rx.badge( "Docs", variant="surface", class_name=( "text-violet-9 text-sm " + rx.cond( rx.State.router.page.path.contains("docs") | rx.State.router.page.path.contains("ai-builder") | rx.State.router.page.path.contains("cloud"), "hidden lg:flex", "hidden", ) ), ), class_name="flex flex-row gap-x-0 items-center", unstyled=True, ), ),
from pcweb.pages.docs import ai_builder as ai_builder_pages
ss_name="shrink-0 hidden dark:block", ), ), class_name="block shrink-0 mr-3", to="/", ) def doc_section(): from pcweb.pages.docs import hosting as hosting_page return ui.navigation_menu.content( resource_item( "AI Builder Docs", ai_builder.overview.best_practices.path, "MagicWand01Icon", 0, ), resource_item( "Open Source Docs", getting_started.introduction.path, "SourceCodeCircleIcon", 0, ), resource_item( "Cloud Docs", hosting_page.deploy_quick_start.path, "CloudServerIcon", 0 ), unstyled=True, class_name=ui.cn( ui.navigation_menu.class_names.CONTENT, "flex flex-col gap-1.5 m-0 p-1.5 w-[280px] min-w-max h-auto", ), ) def new_component_section() -> rx.Component: from pcweb.pages.docs import ai_builder as ai_builder_pages
return ui.navigation_menu.root( ui.navigation_menu.list( ui.navigation_menu.item( rx.box( logo(), rx.badge( "Docs", variant="surface", class_name=( "text-violet-9 text-sm " + rx.cond( rx.State.router.page.path.contains("docs") | rx.State.router.page.path.contains("ai-builder") | rx.State.router.page.path.contains("cloud"), "hidden lg:flex", "hidden", ) ), ), class_name="flex flex-row gap-x-0 items-center", unstyled=True, ), ), rx.cond( rx.State.router.page.p
from pcweb.pages.docs import hosting as hosting_page
"Book a Demo", size="sm", variant="primary", class_name="font-semibold whitespace-nowrap max-xl:hidden", ), ), unstyled=True, class_name="xl:flex hidden", ), ui.navigation_menu.item( navbar_sidebar_button(), class_name="xl:hidden flex", unstyled=True, ), class_name="flex flex-row gap-2 m-0 h-full list-none items-center", ), ui.navigation_menu.portal( ui.navigation_menu.positioner( ui.navigation_menu.popup( ui.navigation_menu.viewport(), ), side_offset=-10, ), ), unstyled=True, class_name="relative flex w-full items-center h-full justify-between gap-6 mx-auto z-[9999] flex-row max-w-[94.5rem]", ) @rx.memo
def navbar() -> rx.Component: return rx.box( hosting_banner(), rx.el.header( new_component_section(), class_name="flex flex-row items-center gap-12 bg-slate-1 shadow-[inset_0_-0.5px_0_0_var(--c-slate-3)] px-4 lg:px-6 w-screen h-[48px] lg:h-[65px]", ), class_name="flex flex-col w-full top-0 z-[9999] fixed text-secondary-12", )
"""The state for the navbar component."""
class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self): self.ai_chat = not self.ai_chat def update_category(self, tag): self.current_category = tag
import reflex as rx
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True
@rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self): self.ai_chat = not self.ai_chat def update_category(self, tag): self.current_category = tag
current_category = "All"
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value
def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self): self.ai_chat = not self.ai_chat def update_category(self, tag): self.current_category = tag
def toggle_banner(self): self.banner = not self.banner
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self):
def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self): self.ai_chat = not self.ai_chat def update_category(self, tag): self.current_category = tag
self.banner = not self.banner
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self):
def toggle_ai_chat(self): self.ai_chat = not self.ai_chat def update_category(self, tag): self.current_category = tag
self.sidebar_open = not self.sidebar_open
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open
def update_category(self, tag): self.current_category = tag
def toggle_ai_chat(self): self.ai_chat = not self.ai_chat
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self):
def update_category(self, tag): self.current_category = tag
self.ai_chat = not self.ai_chat
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self): self.ai_chat = not self.ai_chat
def update_category(self, tag): self.current_category = tag
"""The state for the navbar component.""" import reflex as rx class NavbarState(rx.State): """The state for the navbar component.""" # Whether the sidebar is open. sidebar_open: bool = False search_input: str = "" enter: bool = False banner: bool = True ai_chat: bool = True current_category = "All" @rx.event def set_sidebar_open(self, value: bool): self.sidebar_open = value def toggle_banner(self): self.banner = not self.banner def toggle_sidebar(self): self.sidebar_open = not self.sidebar_open def toggle_ai_chat(self): self.ai_chat = not self.ai_chat def update_category(self, tag):
self.current_category = tag
import os
import reflex_ui as ui import typesense from reflex.experimental import ClientStateVar last_copied = ClientStateVar.create("is_copied", "") suggestion_items = [ { "name": "Components Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deplo
import reflex as rx
import os import reflex as rx
import typesense from reflex.experimental import ClientStateVar last_copied = ClientStateVar.create("is_copied", "") suggestion_items = [ { "name": "Components Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "
import reflex_ui as ui
import os import reflex as rx import reflex_ui as ui
from reflex.experimental import ClientStateVar last_copied = ClientStateVar.create("is_copied", "") suggestion_items = [ { "name": "Components Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "path": "/docs/hos
import typesense
import os import reflex as rx import reflex_ui as ui import typesense
last_copied = ClientStateVar.create("is_copied", "") suggestion_items = [ { "name": "Components Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "path": "/docs/hosting/deploy-quick-start/", "icon": "clo
from reflex.experimental import ClientStateVar
import os import reflex as rx import reflex_ui as ui import typesense from reflex.experimental import ClientStateVar
suggestion_items = [ { "name": "Components Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "path": "/docs/hosting/deploy-quick-start/", "icon": "cloud", "description": "Deploy and host your appl
last_copied = ClientStateVar.create("is_copied", "")
import os import reflex as rx import reflex_ui as ui import typesense from reflex.experimental import ClientStateVar last_copied = ClientStateVar.create("is_copied", "")
CLUSTERS = { "All Content": [], "AI Builder": ["ai_builder"], "Hosting": ["hosting"], "Components": ["custom-components", "recipes"], "Enterprise": ["enterprise"], "API Reference": ["api-reference", "api-routes"], "Docs": [ "advanced_onboarding", "assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False id
suggestion_items = [ { "name": "Components Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "path": "/docs/hosting/deploy-quick-start/", "icon": "cloud", "description": "Deploy and host your application in production environments", }, ]
omponents Overview", "path": "/docs/library", "icon": "blocks", "description": "Discover and explore the full library of available components", }, { "name": "State Management", "path": "/docs/state/overview", "icon": "database", "description": "Master state handling, data flow, and reactive programming", }, { "name": "Event Overview", "path": "/docs/events/events-overview", "icon": "zap", "description": "Learn how to handle user interactions and system events", }, { "name": "Styling and Theming", "path": "/docs/styling/overview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "path": "/docs/hosting/deploy-quick-start/", "icon": "cloud", "description": "Deploy and host your application in production environments", }, ]
TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if se
CLUSTERS = { "All Content": [], "AI Builder": ["ai_builder"], "Hosting": ["hosting"], "Components": ["custom-components", "recipes"], "Enterprise": ["enterprise"], "API Reference": ["api-reference", "api-routes"], "Docs": [ "advanced_onboarding", "assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], }
erview", "icon": "palette", "description": "Customize colors, layouts, and create beautiful app designs", }, { "name": "Deployment Guide", "path": "/docs/hosting/deploy-quick-start/", "icon": "cloud", "description": "Deploy and host your application in production environments", }, ] CLUSTERS = { "All Content": [], "AI Builder": ["ai_builder"], "Hosting": ["hosting"], "Components": ["custom-components", "recipes"], "Enterprise": ["enterprise"], "API Reference": ["api-reference", "api-routes"], "Docs": [ "advanced_onboarding", "assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], }
class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async
TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, }
onents": ["custom-components", "recipes"], "Enterprise": ["enterprise"], "API Reference": ["api-reference", "api-routes"], "Docs": [ "advanced_onboarding", "assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True)
@rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPES
def user_query(self, value: str): self.query = value.replace("rx.", "")
"Enterprise": ["enterprise"], "API Reference": ["api-reference", "api-routes"], "Docs": [ "advanced_onboarding", "assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str):
@rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPES
self.query = value.replace("rx.", "")
, "api-routes"], "Docs": [ "advanced_onboarding", "assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True)
@rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12",
def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = ""
"assets", "authentication", "client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables."""
self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,comp
self.idxed_blogs_results = []
"client_storage", "components", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = []
self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_we
self.idxed_docs_results = []
ponents", "database", "events", "getting_started", "library", "pages", "state", "state_structure", "styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = []
@rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12",
self.query = ""
"styling", "ui", "utility_methods", "vars", "wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter."""
self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12", "per_page": 15, "num_typos": 2, "sort_by": "_text_match:desc", "text_match_threshold": "0.6", "exhaustive_search": True,
if self.selected_filter == selected_filter: return
"wrapping-react", ], "Blog Posts": [], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return
if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12", "per_page": 15, "num_typos": 2, "sort_by": "_text_match:desc", "text_match_threshold": "0.6", "exhaustive_search": True, "highlight_fields": "content",
self.selected_filter = selected_filter
[], } TYPESENSE_CONFIG = { "nodes": [ {"host": os.getenv("TYPESENSE_HOST"), "port": "443", "protocol": "https"} ], "api_key": os.getenv("TYPESENSE_SEARCH_API_KEY"), "connection_timeout_seconds": 2, } class SimpleSearch(rx.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter
@rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12", "per_page": 15, "num_typos": 2, "sort_by": "_text_match:desc", "text_match_threshold": "0.6", "exhaustive_search": True, "highlight_fields": "content", "highlight_full_fields": "content,components", "highlight_sta
if self.query.strip(): yield SimpleSearch.perform_search()
.State): query: str selected_filter: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self:
try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12", "per_page": 15, "num_typos": 2, "sort_by": "_text_match:desc", "text_match_threshold": "0.6", "exhaustive_search": True, "highlight_fields": "content", "highlight_full_fields": "content,components", "highlight_start_tag": "<mark>", "highlight_end_tag": "</mark>", "snippet_threshold": 30, } if self.selected_filter != "All Content": if self.selected_filter == "Blog Posts": search_params["filter_by"] = "section:=Blog" else
if not self.query.strip(): self.idxed_docs_results = [] self.idxed_blogs_results = [] return
: str = "All Content" is_fetching: bool = False idxed_docs_results: list[dict] = [] idxed_blogs_results: list[dict] = [] @rx.event(temporal=True) def user_query(self, value: str): self.query = value.replace("rx.", "") @rx.event(temporal=True) def reset_search(self): """Reset state variables.""" self.idxed_blogs_results = [] self.idxed_docs_results = [] self.query = "" @rx.event(temporal=True) async def apply_filter_search(self, selected_filter: str): """Re-run search with new filter.""" if self.selected_filter == selected_filter: return self.selected_filter = selected_filter if self.query.strip(): yield SimpleSearch.perform_search() @rx.event(background=True, temporal=True) async def perform_search(self): """Perform Typesense search and split results.""" async with self: if not self.query.strip():
self.idxed_blogs_results = [] return try: async with self: self.is_fetching = True yield client = typesense.Client(TYPESENSE_CONFIG) search_params = { "q": self.query, "query_by": "title,content,headings,components", "query_by_weights": "6,8,3,12", "per_page": 15, "num_typos": 2, "sort_by": "_text_match:desc", "text_match_threshold": "0.6", "exhaustive_search": True, "highlight_fields": "content", "highlight_full_fields": "content,components", "highlight_start_tag": "<mark>", "highlight_end_tag": "</mark>", "snippet_threshold": 30, } if self.selected_filter != "All Content": if self.selected_filter == "Blog Posts":
self.idxed_docs_results = []