Skip to main content

reflex-site-shared

Shared site scaffolding used across Reflex's web properties (pages, templates, views, gallery, styles).

Markdown documentation sites

The package can discover a directory of Markdown files, derive routes and navigation, render them with the Reflex documentation component map, and register the pages on an app.

from pathlib import Path

import reflex as rx
from reflex_site_shared import styles
from reflex_site_shared.docs import DocsLayoutConfig, DocsSiteConfig, register_docs

app = rx.App(style=styles.BASE_STYLE)

register_docs(
    app,
    DocsSiteConfig(
        content_dir=Path(__file__).parent.parent / "content",
        route_prefix="/",
        exclude=("drafts/**",),
        navigation_order=("/", "/getting-started/", "/guide/installation/"),
        sitemap_base_url="https://example.com/docs/product",
    ),
    layout_config=DocsLayoutConfig(site_title="Product Documentation"),
)

Enable the shared global CSS in rxconfig.py and install the Fontsource variable fonts referenced by its fonts.css:

from pathlib import Path

import reflex as rx
from reflex_site_shared.docs import DocsSiteConfig
from reflex_site_shared.plugins import DocsMarkdownPlugin, SharedSiteStylesPlugin

docs = DocsSiteConfig(
    content_dir=Path(__file__).parent.parent / "content",
    exclude=("drafts/**",),
)

config = rx.Config(
    app_name="docs_site",
    frontend_packages=[
        "@fontsource-variable/instrument-sans@5.2.8",
        "@fontsource-variable/jetbrains-mono@5.2.8",
    ],
    plugins=[
        rx.plugins.TailwindV4Plugin(),
        SharedSiteStylesPlugin(),
        DocsMarkdownPlugin(docs=docs),
        rx.plugins.RadixThemesPlugin(),
    ],
)

Existing sites that provide their own font CSS can use SharedSiteStylesPlugin(include_fonts=False).

DocsMarkdownPlugin serves each discovered page as Markdown using the same URL convention as the official Reflex docs. For example, /guide/installation/ is also available at /guide/installation.md and /guide/installation/.md. The site's frontend_path is prepended automatically.

The content tree defines the URL tree:

content/
├── index.md                 -> /
├── getting-started.md       -> /getting-started/
└── guide/
    └── installation.md      -> /guide/installation/

Use YAML frontmatter to override the page title and description:

---
title: Installation
description: Install and configure the product.
---

# Installation

Like the official Reflex docs, ordering lives in a centralized Python list. Use DocsSiteConfig.navigation_order to control sidebar and previous/next ordering without adding presentation metadata to each Markdown file.

build_docs_routes returns routes without registering them when the consuming app needs custom SEO or registration behavior. Both build_docs_routes and register_docs accept custom renderer and layout callables. The defaults use the shared responsive docs shell and styled Markdown components.

The default renderer uses the same reflex-docgen pipeline as Reflex's main documentation, including executable example fences, directives, tables, and the shared documentation component map. Generated component API pages can call the exported render_docgen_document helper directly.

Expensive documentation previews

Add defer to a python demo exec fence to mount a heavy preview as it approaches the viewport. The example's source code remains in the initial HTML; the preview reserves 450px of height and stays mounted once shown. This is useful for pages containing many Plotly charts.

Use the marketing site's responsive five-column directory footer in another Reflex site:

from reflex_site_shared.views.marketing_footer import marketing_footer

marketing_footer(show_color_mode_toggle=True)

Load SharedSiteStylesPlugin for its palette, fonts, icons, and button assets. The footer includes newsletter signup, social links, and service status using the package's existing signup/status state. Marketing links use absolute URLs so they work under a docs router basename. The default appearance="light" uses the site's semantic background and follows its color mode; appearance="dark" uses the contrasting primary surface. Theme controls are optional and hidden by default.

Marketing navigation

from reflex_site_shared.views.announcement_banner import announcement_banner
from reflex_site_shared.views.marketing_navbar import (
    marketing_mobile_drawer,
    marketing_navbar,
)

marketing_navbar()  # Fixed header, announcement, desktop menus, and mobile drawer.
marketing_navbar(show_banner=False)
marketing_navbar(banner=my_announcement())
marketing_mobile_drawer()  # Reuse the mobile menu inside a site-specific header.

SharedSiteStylesPlugin includes the announcement persistence and publication-date assets. Marketing destinations use absolute https://reflex.dev links so they work from independently hosted docs apps. The legacy hosting_banner() entry point renders the same announcement. Docs keep their section links and use the shared mobile menu; their article sidebar remains separate.

Metadata

Release files for reflex-site-shared 0.0.46

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reflex-site-shared 0.0.46
File Size Uploaded
reflex_site_shared-0.0.46.tar.gz 177.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reflex-site-shared 0.0.46
File Interpreter ABI Platform
reflex_site_shared-0.0.46-py3-none-any.whl Python 3 none any Details

Total release size: 395.8 kB

Release files / reflex_site_shared-0.0.46.tar.gz

Download URL reflex_site_shared-0.0.46.tar.gz
Size 177.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b5a5902b95a6cb3034aad5109ba23f5e12c680ef031b0ca82cdb10a9652d149f
BLAKE2b-256 checksum
How to use checksums
b67f9f31b85ea55c635418646133a446a87fbc38b25f079a53ff779157d0f9f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / reflex_site_shared-0.0.46-py3-none-any.whl

Download URL reflex_site_shared-0.0.46-py3-none-any.whl
Size 218.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd9f8314aa6af1ec0e593eb8112874fffb1cf9e9f4c0e3dab865b96ee7b05b30
BLAKE2b-256 checksum
How to use checksums
857706b4e265ddeefa6b94f562ebad644c4d0f1d038609b6498740497663a017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.46 This release

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page