brycewang-stanford/Auto-Empirical-Research-Skills / skills/17-DAAF-Contribution-Community-daaf/dot-claude/skills/marimo
marimo
VerifiedReactive Python notebook system. Cell reactivity, UI elements (sliders, dropdowns, tables), SQL cells, plotting, app deployment. Use when assembling Stage 9 notebooks, building data apps, or converting Jupyter to marimo .py format.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.1 KB |
| references/apps-deployment.md | markdown | 5.3 KB |
| references/gotchas.md | markdown | 5.7 KB |
| references/outputs-layouts.md | markdown | 4.6 KB |
| references/quickstart.md | markdown | 4.1 KB |
| references/reactivity.md | markdown | 4.7 KB |
| references/sql-data.md | markdown | 5.3 KB |
| references/ui-elements.md | markdown | 6.6 KB |
| references/validation-patterns.md | markdown | 13.4 KB |
references/outputs-layouts.md
View on GitHub# Outputs & Layouts
## Cell Outputs
The **last expression** in a cell is its output. Any Python object can be an output.
```python
# This is the output
"Hello, world!"
```
```python
# DataFrame becomes interactive table
df
```
```python
# Plot renders automatically
chart
```
## Markdown
### Basic Markdown
```python
mo.md("# Heading\n\nParagraph with **bold** and *italic*.")
```
### Dynamic Markdown (f-strings)
Interpolate Python values:
```python
name = "Alice"
score = 95
mo.md(f"""
# Report for {name}
Final score: **{score}%**
""")
```
### Embed UI Elements
```python
slider = mo.ui.slider(1, 100)
mo.md(f"""
## Configuration
Select value: {slider}
Current: {slider.value}
""")
```
### LaTeX Math
```python
mo.md(r"""
The quadratic formula:
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
Inline math: $E = mc^2$
""")
```
### Mermaid Diagrams
````python
mo.md("""
```mermaid
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
```
""")
````
### Admonitions / Callouts
```python
mo.callout("This is important!", kind="warn")
# Kinds: "info", "warn", "danger", "success"
```
Or in markdown:
```python
mo.md("""
!!! note "Title"
Content here
""")
```
## Multiple Outputs
A cell can only have one output. Use these to combine:
### Vertical Stack
```python
mo.vstack([
mo.md("# Title"),
chart,
table
])
```
With gap:
```python
mo.vstack([item1, item2], gap=2) # gap in rem units
```
### Horizontal Stack
```python
mo.hstack([
left_panel,
right_panel
])
```
With alignment:
```python
mo.hstack([a, b], justify="space-between", align="center")
# justify: "start", "center", "end", "space-between", "space-around"
# align: "start", "center", "end", "stretch"
```
### Grid
```python
mo.hstack([
mo.vstack([a, b]),
mo.vstack([c, d])
])
```
## Layout Components
### Tabs
```python
mo.ui.tabs({
"Overview": overview_content,
"Data": data_table,
"Charts": chart_content
})
```
### Accordion
Collapsible sections:
```python
mo.accordion({
"Section 1": content1,
"Section 2": content2,
"Section 3": content3
})
```
### Sidebar
Fixed sidebar navigation:
```python
mo.sidebar([
mo.md("# Navigation"),
nav_links,
settings_panel
])
```
### Carousel
Swipeable content:
```python
mo.carousel([slide1, slide2, slide3])
```
### Tree View
```python
mo.tree({
"Root": {
"Child 1": "Leaf",
"Child 2": {
"Grandchild": "Leaf"
}
}
})
```
## Status & Progress
### Progress Bar
```python
with mo.status.progress_bar(total=100) as bar:
for i in range(100):
do_work()
bar.update()
```
### Spinner
```python
with mo.status.spinner("Loading..."):
result = slow_operation()
```
### Toast Notifications
```python
mo.toast("Operation complete!", kind="success")
# Kinds: "info", "success", "warn", "danger"
```
## Conditional Output
### Show/Hide
```python
show_details = mo.ui.checkbox(label="Show details")
mo.md(f"""
Summary here...
{mo.md("**Details:** ...") if show_details.value else ""}
""")
```
### mo.stop for Conditional Cells
```python
data_loaded = mo.ui.checkbox(label="Data ready")
mo.stop(
not data_loaded.value,
mo.callout("Check the box when data is ready", kind="info")
)
# This only runs if checkbox is checked
process_data()
```
## Media
### Images
```python
mo.image("path/to/image.png")
mo.image("https://example.com/image.png")
mo.image(bytes_data, format="png")
```
### Video
```python
mo.video("video.mp4")
mo.video("https://example.com/video.mp4")
```
### Audio
```python
mo.audio("audio.mp3")
```
### PDF
```python
mo.pdf("document.pdf")
```
### Download Button
```python
mo.download(data=csv_string, filename="data.csv", label="Download CSV")
```
## HTML & Styling
### Raw HTML
```python
mo.Html("<div style='color: red'>Custom HTML</div>")
```
### Center Content
```python
mo.center(content)
```
### Plain Text (No Formatting)
```python
mo.plain_text(code_output)
```
### JSON Viewer
```python
mo.json({"key": "value", "nested": {"a": 1}})
```
## App Width
In notebook settings, configure:
- **Compact**: Narrow, centered
- **Medium**: Default
- **Full**: Edge-to-edge
Or set per-cell with CSS.
## Console Output
By default, `print()` output appears below the cell. To capture:
```python
with mo.capture_stdout() as captured:
print("Hello")
captured.getvalue() # "Hello\n"
```
## Tips
- Use `mo.vstack`/`mo.hstack` to compose complex layouts
- Tabs are great for organizing multiple views
- `mo.stop()` is powerful for step-by-step workflows
- Embed UI elements directly in markdown for clean interfaces
- Use callouts to highlight important information
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |