Skip to main content

Widgets to use with marimo notebooks

Project description

dr_widget

dr_widget is a library of reusable AnyWidget components that can be dropped into Marimo notebooks. Widgets are organized into two tiers based on their physical shape:

  • Inline widgets (dr_widget.inline) – pure-Python widgets whose JS is a short string literal. Zero build step, minimal deps. Useful for small browser-side helpers.
  • Bundled widgets (dr_widget.bundled) – widgets backed by their own JS workspace (Svelte, React, etc.) that builds to a static/ bundle. Useful when you need a component library or transpilation.

The top-level dr_widget package is intentionally empty so importing from one tier does not drag in the other.

Quick Start

# Install JS dependencies (root + workspace)
bun install

# Live-reload the Config File Manager widget in a browser
bun run dev:config-file-manager

# Produce the optimized bundle used by AnyWidget
bun run build

# Build the Python distributions (wheel + sdist)
uv build

# Launch the Marimo demo notebook
marimo run notebooks/config_file_manager_widget.py

Prerequisites: Bun ≥ 1.0, Node-compatible environment, Python ≥ 3.11 with uv, and Marimo ≥ 0.23.

Repository Layout

  • src/dr_widget/ – Python package with two widget tiers.
    • inline/ – pure-Python AnyWidgets (e.g., ActiveHtml) with _esm as a string literal.
    • bundled/config_file_manager/ – bundled widget workspace (Svelte source in src/, build output in static/).
      • src/ConfigFileManager.svelte – orchestration layer wiring bindings into the panel components.
      • src/lib/hooks/use-file-bindings.ts – shared logic for syncing AnyWidget traitlets.
      • src/lib/components/ – shadcn-style UI primitives and panels, including a config viewer card with both a tree view and graph view for JSON payloads.
  • docs/ – additional reference material (architecture, development workflows).
  • notebooks/config_file_manager_widget.py – Marimo notebook that exercises the Config File Manager widget.

Documentation

Contributing

  1. Work inside a dedicated branch.
  2. Run bun run build, npx svelte-check, and uv build before opening a PR.
  3. Update the notebook and docs when you add or change widget behaviour.
  4. Follow the commit and PR practices outlined in AGENTS.md.

Please open an issue if you hit build problems or want to discuss new widgets.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dr_widget-0.2.0.tar.gz (584.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dr_widget-0.2.0-py3-none-any.whl (638.4 kB view details)

Uploaded Python 3

File details

Details for the file dr_widget-0.2.0.tar.gz.

File metadata

  • Download URL: dr_widget-0.2.0.tar.gz
  • Upload date:
  • Size: 584.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for dr_widget-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d241274a8d26bc0ff8423e5fed14e935b2a04f95d8f83dd75c351408a031865e
MD5 c00b3ae8a0f55eabd6bc112821f86ede
BLAKE2b-256 93ba68f6c5b7d87f3afbd952961fa4b3356a42409f6cda3143fe4b5a20abcd2d

See more details on using hashes here.

File details

Details for the file dr_widget-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dr_widget-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 638.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for dr_widget-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abf6ef2a262dc3093ba2c0c6baf04f92e2d496849e9869762014cb66075d8142
MD5 69a0c02d47250a3d60da9e60973ff0ea
BLAKE2b-256 9c5495f47db416b83660529a4172c9c305a4e71944b5c328c918629e9f57df0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page