Skip to content

Add ReactPy-Router to Your Project

Install from PyPI

Run the following command to install reactpy-router in your Python environment.

pip install reactpy-router

Quick Start

You're now ready to start building your own ReactPy applications with URL routing. For example...

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from reactpy import component, html, run

from reactpy_router import browser_router, route


@component
def root():
    return browser_router(
        route("/", html.h1("Home Page 🏠")),
        route("{404:any}", html.h1("Missing Link 🔗‍💥")),
    )


run(root)

Last update: October 24, 2024