Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

It's React, but in Jupyter

License

NotificationsYou must be signed in to change notification settings

reactive-python/reactpy-jupyter

Repository files navigation

A client forReactPy implemented using Jupyter widgets

Try It Now!

Check out some live examples by clicking the badge below:

Binder

Getting Started

To install usepip:

pip install reactpy_jupyter

Usage

Once you're donegetting started, you can author and display ReactPylayouts natively in your Jupyter Notebook:

importreactpy@reactpy.componentdefClickCount():count,set_count=reactpy.hooks.use_state(0)returnreactpy.html.button(        {"onClick":lambdaevent:set_count(count+1)},        [f"Click count:{count}"],    )ClickCount()

You can also turn anreactpy element constructor into one that returns anipywidget withthereactpy_juptyer.to_widget function. This is useful if you wish to use ReactPy in combinationwith other Jupyter Widgets as in the following example:

ClickCountWidget=reactpy_jupyter.to_widget(ClickCount)ipywidgets.Box(    [ClickCountWidget(),ClickCountWidget(),    ])

For a more detailed introduction check out this live demo here:

Binder

Development Installation

For a development installation (requiresNode.js andYarn version 1),

$ git clone https://github.com/reactive-python/reactpy-jupyter.git$ cd reactpy-jupyter$ pip install -e .

To automatically re-build and refresh Jupyter when making changes start a Vite dev server:

$ npx vite

Then, before importingreactpy_jupyter set the following environment variable:

importosos.environ["REACTPY_JUPYTER_DEV"]="1"importreactpy_jupyter

About

It's React, but in Jupyter

Topics

Resources

License

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp