Examples - marimo (original) (raw)
This page includes dozens of bite-sized how-to examples to help you get started with marimo. Be sure to also read the quickstart and the user guide, especially the guide on how marimo runs cells.
Get inspired at our gallery!
For inspirational examples, including embedding-driven data labelers, Stanford-scientist authored tutorials, and more, check out our public gallery.
Running cells¶
- ⚡️ Basic execution
- 🐞 Getting around multiple definition errors
- 🛑 Stop cells from running
- 🖱️ Run cells on button click
- 🕓 Refresh on a timer
- ⏳ Run async functions
- 💾 Caching computations in memory
- 💾 Cache computations to persistent storage
- 🐞 Using the debugger
- 🐍 Run notebooks as scripts
Visual Outputs¶
- 📤 Cell outputs
- ✍️ Basic markdown
- 💬 Console outputs
- 📋 Capturing console output
- 📈 Showing plots
- 🎥 Showing videos and other media
- 🎛️ Conditionally showing outputs
- 🧩 Showing multiple outputs in one cell
Writing markdown¶
* 🪄 Mermaid diagrams
* 🚨 Admonitions
* 📂 Collapsible details
- 😀 Emoji
Working with data¶
Dataframes¶
marimo is designed for working with dataframes. Here are a few examples; see the dataframes guide for details.
* 🔍 Select dataframe rows
* ✏️ Editable dataframe
* 🛠️ Interactive dataframe transformer
SQL¶
Here are some basic examples, see the SQL guide for more details.
Plots¶
See the plotting guide for a full overview.
* 📉 Selecting data with Plotly
Progress bars and status elements¶
* 🌀 Loading spinner
Layouts¶
* 📁 Accordion toggle
* 🗂️ Tabs
Input elements¶
Basic input elements¶
marimo has a large library of interactive UI elements, which you can use without callbacks — just make sure to assign elements to global variables. See the API reference for a full list, and the interactivity guide for rules governing how UI elements work.
- 🎚️ Slider
* 🧾 Dropdown
* 👆 Multi-select
* 🔘 Radio buttons
* ☑️ Checkbox
* 📅 Date
* 📁 File
* 🔤 Text input
* 📝 Text area
* 🧑💻 Code editor
* 🔍 Table
* 🎙️ Microphone
* 💬 Chat
Composite input elements¶
Composite input elements let you create a single UI element from multiple other UI elements.
- 🧾 Form