skillfed

anywidget

custom jupyter widgets made easy

anywidget v0.11.0 3.9M downloads/30d#2,473 on PyPI918
Permissive license MIT Active released

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 anywidget

uv

uv add anywidget

poetry

poetry add anywidget

Installing 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

Framework :: JupyterFramework :: Jupyter :: JupyterLabFramework :: Jupyter :: JupyterLab :: 4Framework :: Jupyter :: JupyterLab :: ExtensionsFramework :: Jupyter :: JupyterLab :: Extensions :: PrebuiltLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3

Tags

jupyter custom widgetsinteractive notebook widgetsreusable jupyter componentsweb-based notebook UIjupyter widget frameworkcustom interactive controlsnotebook widget library
jupyter-widgetsinteractive-notebooksweb-components

More Application Frameworks packages