Purpose | Badges |
---|---|
Latest (master: future 8.0) | |
Stable (7.6.3) | |
Communication | |
ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel.
Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data.
Learning becomes an immersive, fun experience. Researchers can easily see how changing inputs to a model impact the results. We hope you will add ipywidgets to your notebooks, and we're here to help you get started.
The fundamental widgets provided by this library are called core interactive widgets. A demonstration notebook provides an overview of the core interactive widgets, including:
- sliders
- progress bars
- text boxes
- toggle buttons and checkboxes
- display areas
- and more
Besides the widgets already provided with the library, the framework can be extended with the development of custom widget libraries. For detailed information, please refer to the ipywidgets documentation.
A template project for building custom widgets is available as a cookiecutter. This cookiecutter project helps custom widget authors get started with the packaging and the distribution of their custom Jupyter interactive widgets. The cookiecutter produces a project for a Jupyter interactive widget library following the current best practices for using interactive widgets. An implementation for a placeholder "Hello World" widget is provided as an example.
Popular widget libraries such as bqplot, pythreejs and ipyleaflet follow exactly the same template and directory structure. They serve as more advanced examples of usage of the Jupyter widget infrastructure.
Examples of custom widget libraries built upon ipywidgets are
- bqplot a 2d data visualization library enabling custom user interactions.
- pythreejs a Jupyter - Three.js wrapper, bringing Three.js to the notebook.
- ipyleaflet a leaflet widget for Jupyter.
The stable version of ipywidgets can be installed with pip or conda. If using JupyterLab, review the Front-end extension for JupyterLab section.
pip install ipywidgets
# Skip the next step if using JupyterLab or Classic notebook version 5.3 and above
jupyter nbextension enable --py --sys-prefix widgetsnbextension
conda install -c conda-forge ipywidgets
Install the front-end extension to JupyterLab (note that this requires nodejs to be installed):
- For JupyterLab 1.0.x and 1.1.x, use
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0
- For JupyterLab 1.2.x, use
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1
- For JupyterLab 2.x, use
jupyter labextension install @jupyter-widgets/jupyterlab-manager@2.0
See the Installation section of the documentation for additional details.
Installing from source is more complicated and requires a developer install, see the detailed developer install instructions.
If you want to install ipywidgets from source, you will need the
yarn package manager version 1.2.1 or later.
To install the latest master version from the root directory of the source
code, run dev-install.sh
. To only build the Python package enter
pip install -e .
.
See the examples section of the documentation. The widgets are being used in a variety of ways; some uses can be seen in these notebooks: Demo notebook of interactive widgets
Refer to change log for more detail.
ipywidgets | JupyterLab | Classic Notebook | nbclassic |
---|---|---|---|
master | - | TBD | |
7.6.3 | 0.2.6 | ||
Legacy | |||
6.x | - | ||
5.x | 4.2 | - | |
4.1.x | 4.1 | - | |
4.0.x | 4.0 | - |
We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.
See the LICENSE file in this repository for details.