anywidget
custom jupyter widgets made easy
What it is and what it does
anywidget is a framework for authoring custom interactive widgets that run in Jupyter notebooks and compatible environments. Instead of using complex scaffolding templates, you define a Python class that inherits from anywidget.AnyWidget, attach JavaScript code (inline or from a file), and optionally add CSS styling. The framework handles syncing state between Python and the browser, letting you write interactive controls without leaving your notebook or Python package.
The package is designed for both prototyping (write a widget directly in a .ipynb or .py file) and publishing (distribute your widget to others via PyPI like any normal Python package). It works across Jupyter, JupyterLab, Google Colab, VSCode, and marimo, with hot module replacement during development. Runtime dependencies are minimal: ipywidgets for the underlying widget protocol, psygnal for event signaling, and typing-extensions for type hints.
Use it for:
- Build a custom data visualization or control panel in a notebook without learning Jupyter's widget extension architecture.
- Create a reusable interactive component and publish it to PyPI for others to install and use.
- Prototype a widget interactively in a notebook cell, then move the JavaScript to a separate file for cleaner development.
- Share interactive educational materials or dashboards that work consistently across Jupyter, Colab, and VSCode notebooks.
- Develop widgets that sync state between Python and browser-based UI without manual serialization.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
anywidget lets you build custom interactive widgets for Jupyter and other notebook environments by writing Python classes with embedded or separate JavaScript/CSS, then publish them as standard PyPI packages.
Yes. anywidget is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. Install it if you need to build or use custom interactive widgets in Jupyter notebooks without the overhead of traditional Jupyter extension development. The three-dependency footprint and recent release history make it a safe, practical choice for notebook-based interactive computing.
Install
anywidget on PyPI
pip
pip install anywidgetuv
uv add anywidgetpoetry
poetry add anywidgetInstalling anywidget
Before you install
Low friction: pure Python wheel with only three runtime dependencies (ipywidgets, psygnal, typing-extensions). Active maintenance with a recent release 109 days ago and 918 repository stars.
License in practice
MIT license (permissive) means you can use, modify, and distribute anywidget and code built with it freely, including in commercial projects, with minimal restrictions.
Quickstart
pip install anywidget
import anywidget
import ipywidgets
class CounterWidget(anywidget.AnyWidget):
_esm = """export default { render({ model, el }) { el.textContent = model.get('value'); } };"""
value = ipywidgets.widget_int(0)
Requires Python 3.10 or later.
Verify before relying
- Whether the package works equally well in all listed environments (Jupyter, JupyterLab, Google Colab, VSCode, marimo) or if some have better support than others.
- Performance characteristics and memory footprint when running many widgets simultaneously in a notebook.
- How state synchronization between Python and JavaScript behaves under different network conditions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — ipywidgets, psygnal, typing-extensions |
| Maintenance | actively maintained — 109 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,865,139/month — #2,473 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: anywidget-0.11.0-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
rerun-notebookProvides Jupyter notebook integration for…
permissive · top 15,000 on PyPI
widgetsnbextensionProvides the JavaScript frontend and…
permissive · top 1,000 on PyPI
ipytreeipytree provides a tree-structure widget for…
permissive · top 15,000 on PyPI
voilaVoilà converts Jupyter notebooks into…
permissive · top 15,000 on PyPI
jupyterlab-widgetsEnables Jupyter/IPython widgets to render and…
permissive · top 1,000 on PyPI
ipyvueProvides a Jupyter widget base for building…
permissive · top 15,000 on PyPI
jupyter-leafletjupyter-leaflet provides interactive map…
permissive · top 15,000 on PyPI
ipywidgetsipywidgets provides interactive HTML widgets…
permissive · top 1,000 on PyPI
ipyeventsipyevents provides a Jupyter widget that…
permissive · top 15,000 on PyPI
pythreejsPythreejs bridges Python and Three.js to render…
permissive · top 15,000 on PyPI