2026-07-13 –, Viz
This tutorial is for anyone who works with data in Python notebooks. marimo is a reactive notebook that can serve as a personal data environment. Cells run in a deterministic order based on their dependencies, interactivity is built in, and notebooks are self-contained Python scripts you can share, version, and deploy. We start with a tour of marimo: its execution model, interactive elements, SQL, plotting, and sharing. From there, we get practical, composing off-the-shelf UI elements to build interactive tools for your data, then creating your own custom widgets with anywidget when you need something tailored to your workflow.
marimo is a reactive Python notebook. Cells declare dependencies through variable references, and the runtime executes them in a deterministic order. Notebooks are stored as pure Python scripts with inline dependency metadata (PEP 723), so they carry everything needed to reproduce themselves. Prior web experience is not required for most of the tutorial, but familiarity with HTML, CSS, and JavaScript will help in the custom widget sections.
The tutorial is split into four sections.
A tour of marimo. Covers the reactive execution model, cell types (Python, SQL, markdown), plotting (matplotlib, Altair), and built-in UI elements (sliders, dropdowns, tables, interactive charts, dataframe explorers). Shows how elements compose across cells: a dropdown drives a chart, a selection filters a dataframe, a table displays the result. Also covers grouping patterns (arrays, dictionaries, batch, form), layout (tabs, accordion, sidebar, grid), and editor features like the dependency graph, package management, and app view.
Building custom widgets with anywidget. Sometimes you need a specialized view of your data, a custom visualization to explore a relationship, or an interface tailored to a specific analysis. anywidget lets you build these: you define an ESM module and a Python class, and it handles the communication between Python and the browser. Covers one-way and two-way data bindings, importing third-party JavaScript libraries (D3, Leaflet), and modern JavaScript fundamentals. Each exercise builds on the last. Custom widgets participate in marimo's dataflow graph like any built-in element.
Beyond the notebook. Covers how to get your work out of the editor and in front of others. marimo notebooks are stored as Python files and can be executed as standalone scripts (e.g., uv run my_notebook.py), but also viewed and shared in a variety of ways depending on audience (e.g., interactive web app, exported as a PDF, turned into slides). They can be versioned on GitHub, published as gists, exported as WASM pages, or shared on molab (https://molab.marimo.io), a cloud-hosted workspace for marimo notebooks.
Open exploration. Q/A, advanced topics (packaging widgets to PyPI, the widget ecosystem), or one-on-one help. Contact us in advance with your project so we can plan accordingly.
Learning Goals
After this tutorial, attendees will be able to:
- Work in marimo's reactive execution model
- Compose built-in interactive elements across cells
- Build custom widgets with anywidget
- Share and deploy marimo notebooks in multiple formats
Prerequisites
Attendees should have basic understanding of:
- Python: imports, if statements, for loops, function definitions, class definitions, return statements
- Python environments: ability to create a new environment for the tutorial
- Notebooks: launch a notebook, code in cells, execute code
- Python data science libraries: basic knowledge of NumPy arrays and Pandas DataFrames
- Web fundamentals (custom widget sections only): basic JavaScript (functions, arrow functions, async) and basic DOM manipulation. No need to be an expert; we cover what you need.
Outline
Part 1: A tour of marimo (~60 min)
- Reactivity: cells, variables, and the dataflow graph
- Cell types: Python, SQL, markdown
- Plotting: matplotlib, Altair
- UI elements: sliders, dropdowns, number inputs, tables, interactive charts, dataframe explorer
- Composing elements across cells: a dropdown drives a chart, a selection filters a dataframe
- Grouping patterns: mo.ui.array, mo.ui.dictionary, mo.ui.batch, mo.ui.form
- Layout: mo.hstack, mo.vstack, tabs, accordion, sidebar, grid
- Editor features: dependency graph, package management, app view
- Hands-on: build an interactive data explorer
Part 2: Building custom widgets with anywidget (~60 min)
- Motivation: specialized views, custom visualizations, tailored interfaces
- Modern JavaScript fundamentals: ESM, web platform APIs, the DOM
- How Python and the browser communicate (widget protocol)
- "Hello world" anywidget (one-way data binding)
- Counter widget (two-way data binding)
- Importing third-party JavaScript libraries (e.g., D3, Leaflet)
- Accessing selections, serializing dataframes, sending binary data
- Composing custom widgets with built-in elements in the dataflow graph
- Hands-on: build a custom widget for a specific data task
Part 3: Beyond the notebook (~30 min)
- Running notebooks headless as scripts
- Inline dependencies (PEP 723) and sandboxed execution with uv
- App mode: serving notebooks as interactive apps with marimo run
- Exporting: PDFs with rich outputs, slides
- Sharing: molab, GitHub gists, WASM standalone pages
- Hands-on: export and share a notebook in multiple formats
Part 4: Open exploration (~30 min)
- Packaging and publishing widgets to PyPI
- Tour of the anywidget/widget ecosystem
- Q/A and one-on-one help with personal projects
Attendees should have basic understanding of:
- Python: imports, if statements, for loops, function definitions, class definitions, return statements
- Python environments: ability to create a new environment for the tutorial
- Notebooks: launch a notebook, code in cells, execute code
- Python data science libraries: basic knowledge of NumPy arrays and Pandas DataFrames
- Web fundamentals (custom widget sections only): basic JavaScript (functions, arrow functions, async) and basic DOM manipulation. No need to be an expert; we cover what you need.
Trevor is a researcher and software engineer working on interactive computing tools in Python. He completed his PhD in the HIDIVE Lab at Harvard Medical School, where he developed interactive visualization and analysis tools for biological and AI applications. He created anywidget and contributes to open-source data tooling. Trevor now works at marimo, building a reactive notebook environment for Python. He lives in Brooklyn, NY with his two cats, Laird and Minnow, whom he’s very fond of.