shinyreact 
shinyreact lets you write the UI of a Shiny for Python app as a React client you own, while the Python server contains only reactive computation. It provides the bridge between the two and ships zero UI components itself. The same JavaScript bundle backs the R package, so one React client works against an app.py or an app.R server. The full site covers all three.
Installation
pip install shinyreact
Or install the development version from GitHub:
pip install "git+https://github.com/posit-dev/shinyreact.git"
Usage
set_react_page() discovers www/ui.js (and www/ui.css, if present) next to the app file and serves them as the page. @reactive_output publishes any JSON-serializable value to the client's useShinyOutputValue() hook:
from shiny.express import input
from shinyreact import reactive_output, set_react_page
set_react_page()
@reactive_output
def greeting():
return f"Hello, {input.name()}!"
In Core mode, page_react() is the ui argument instead:
from shiny import App
from shinyreact import page_react, reactive_output
def server(input, output, session):
@reactive_output
def greeting():
return f"Hello, {input.name()}!"
app = App(page_react(), server)
The matching www/ui.js:
const { React, ReactDOM, useShinyInput, useShinyOutputValue } = window.shinyreact;
const h = React.createElement;
function App() {
const [name, setName] = useShinyInput("name", "world");
const greeting = useShinyOutputValue("greeting");
return h(
"div",
null,
h("input", { value: name, onChange: (e) => setName(e.target.value) }),
h("p", null, greeting)
);
}
ReactDOM.createRoot(document.body.appendChild(document.createElement("div"))).render(h(App));
Try a complete app:
git clone https://github.com/posit-dev/shinyreact
shiny run shinyreact/examples/01-hello/app.py
Learn more
- Get started walks through the
ui.tsxpattern: inputs, outputs, messages, and embedding traditional Shiny renderers. - TSX files and JavaScript build tools explains
.tsx, JSX, TypeScript, and whatnpm run builddoes. - Client hooks lists everything at
window.shinyreact. - Testing covers shiny's
local_serverpytest fixture for driving a server with no browser, andWireTapfor wire payloads in Playwright tests. - Agent Skills explains the skills that ship with the package for coding agents.
- The examples catalog lists runnable apps from no-build to Vite + HMR.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shinyreact-0.1.0.tar.gz.
File metadata
- Download URL: shinyreact-0.1.0.tar.gz
- Upload date:
- Size: 114.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df1d2f844fa5d3a070738611fa334796e56122e69e2b48f9dd024228403eb97
|
|
| MD5 |
167c246ec4061913a6522294113da132
|
|
| BLAKE2b-256 |
1491dfc7ababee605370df61e364bda38c8600d5fe9fb2ee010fbf39ce209093
|
Provenance
The following attestation bundles were made for shinyreact-0.1.0.tar.gz:
Publisher:
release-py.yaml on posit-dev/shinyreact
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shinyreact-0.1.0.tar.gz -
Subject digest:
3df1d2f844fa5d3a070738611fa334796e56122e69e2b48f9dd024228403eb97 - Sigstore transparency entry: 2813256789
- Sigstore integration time:
-
Permalink:
posit-dev/shinyreact@c94ae9bcd4b7881eaa5456e64b2b47e958e6d2fd -
Branch / Tag:
refs/tags/py/v0.1.0 - Owner: https://github.com/posit-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-py.yaml@c94ae9bcd4b7881eaa5456e64b2b47e958e6d2fd -
Trigger Event:
push
-
Statement type:
File details
Details for the file shinyreact-0.1.0-py3-none-any.whl.
File metadata
- Download URL: shinyreact-0.1.0-py3-none-any.whl
- Upload date:
- Size: 122.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31d5c69787274b6455e94386c082e6cc76b0b0526dcd2972029d64b930453962
|
|
| MD5 |
27dd99e6264f5a6b8243f4212103f6ff
|
|
| BLAKE2b-256 |
ad02c9b5e49461026eedd5728c91fa8e5ef3eb292f0a3ad4d8fa66144fa9905e
|
Provenance
The following attestation bundles were made for shinyreact-0.1.0-py3-none-any.whl:
Publisher:
release-py.yaml on posit-dev/shinyreact
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shinyreact-0.1.0-py3-none-any.whl -
Subject digest:
31d5c69787274b6455e94386c082e6cc76b0b0526dcd2972029d64b930453962 - Sigstore transparency entry: 2813256817
- Sigstore integration time:
-
Permalink:
posit-dev/shinyreact@c94ae9bcd4b7881eaa5456e64b2b47e958e6d2fd -
Branch / Tag:
refs/tags/py/v0.1.0 - Owner: https://github.com/posit-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-py.yaml@c94ae9bcd4b7881eaa5456e64b2b47e958e6d2fd -
Trigger Event:
push
-
Statement type: