streamlit-to-marimo
Original:🇺🇸 English
Translated
Convert a Streamlit app to a marimo notebook
3installs
Sourcemarimo-team/skills
Added on
NPX Install
npx skill4agent add marimo-team/skills streamlit-to-marimoTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Converting Streamlit Apps to Marimo
For general marimo notebook conventions (cell structure, PEP 723 metadata, output rendering, , variable naming, etc.), refer to the skill. This skill focuses specifically on mapping Streamlit concepts to marimo equivalents.
marimo checkmarimo-notebookSteps
-
Read the Streamlit app to understand its widgets, layout, and state management.
-
Create a new marimo notebook following theskill conventions. Add all dependencies the Streamlit app uses (pandas, plotly, altair, etc.) — but replace
marimo-notebookwithstreamlit. You should not overwrite the original file.marimo -
Map Streamlit components to marimo equivalents using the reference tables below. Key principles:
- UI elements are assigned to variables and their current value is accessed via .
.value - Cells that reference a UI element automatically re-run when the user interacts with it — no callbacks needed.
- UI elements are assigned to variables and their current value is accessed via
-
Handle conceptual differences in execution model, state, and caching (see below).
-
Runon the result and fix any issues.
uvx marimo check
Widget Mapping Reference
Input Widgets
| Streamlit | marimo | Notes |
|---|---|---|
| | |
| | Pass discrete values via |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | No dedicated time widget |
| | Use |
| | No dedicated color picker |
| | Use |
| | Returns a download link element |
| | Wraps any element so its value only updates on submit |
Display Elements
| Streamlit | marimo | Notes |
|---|---|---|
| | |
| | Supports f-strings: |
| | marimo uses KaTeX; see |
| | |
| | DataFrames render as interactive marimo widgets natively; use |
| | Use |
| | |
| | |
| | |
| | |
| |
Charts
| Streamlit | marimo | Notes |
|---|---|---|
| | Use |
| | Use |
| | Use |
Layout
| Streamlit | marimo | Notes |
|---|---|---|
| | Pass a list of elements |
| | Use |
| | Dict of |
| | Dict of |
| | |
| | |
| | |
| | Context manager |
Key Conceptual Differences
Execution Model
Streamlit reruns the entire script top-to-bottom on every interaction. Marimo uses a reactive cell DAG — only cells that depend on changed variables re-execute.
- No need for — reactivity is automatic.
st.rerun() - No need for — structure cells so downstream cells naturally depend on upstream values.
st.stop()
State Management
| Streamlit | marimo |
|---|---|
| Regular Python variables between cells |
Callback functions ( | Cells referencing |
| |
Caching
| Streamlit | marimo |
|---|---|
| |
| |
@mo.cachefunctools.cache@mo.persistent_cacheMulti-Page Apps
Marimo offers two approaches for multi-page Streamlit apps:
- Single notebook with routing: Use with
mo.routesormo.nav_menuto build multiple "pages" (tabs/routes) inside one notebook.mo.sidebar - Multiple notebooks as a gallery: Run a folder of notebooks with to serve them as a gallery with navigation.
marimo run folder/
Deploying
marimo features molab to host marimo apps instead of the streamlit community cloud. You can generate an "open in molab" button via the skill.
add-molab-badgeCustom components
streamlit has a feature for custom components. These are not compatible with marimo. You might be able to generate an equivalent anywidget via the skill but discuss this with the user before working on that.
marimo-anywidget