DAAF-Contribution-Community/daaf / .claude/skills/marimo
marimo
VerifiedReactive Python notebook system with cell reactivity, UI elements, SQL cells, plotting, and app deployment. DAAF's standard notebook format — stored as Git-friendly .py files, not .ipynb. For DAAF pipelines, Stage 9 literally archives existing executed scripts in bounded comment/pass cells paired with real execution logs; optional display-only cells may preview existing Parquet data or show already-created figures, but may not analyze data or generate figures. Use when assembling Stage 9 research notebooks, building standalone interactive data apps, or converting Jupyter notebooks to marimo format. R equivalent: quarto — when execution language is R, use quarto instead.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 20.1 KB |
| references/apps-deployment.md | markdown | 15.1 KB |
| references/gotchas.md | markdown | 5.8 KB |
| references/outputs-layouts.md | markdown | 6.0 KB |
| references/quickstart.md | markdown | 9.2 KB |
| references/reactivity.md | markdown | 5.1 KB |
| references/sql-data.md | markdown | 5.7 KB |
| references/ui-elements.md | markdown | 8.4 KB |
| references/validation-patterns.md | markdown | 19.7 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: "neutral" (default), "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
})
```
Signature in 0.25.0: `mo.accordion(items, multiple=False, lazy=False, *, expanded=False)`. String values in `items` are rendered as markdown.
```python
# Let several sections be open at once
mo.accordion({"Summary": summary, "Details": details}, multiple=True)
# Wrap each section in mo.lazy, so its content renders only when opened
mo.accordion({"View total": expensive_item}, lazy=True)
# Start with a section open (expanded is keyword-only, new since 0.19.11)
mo.accordion({"Summary": summary, "Details": details}, expanded=["Details"])
# expanded=True opens the first item, or every item with multiple=True
mo.accordion({"Summary": summary, "Details": details}, multiple=True, expanded=True)
```
`expanded` takes `True`/`False` or a list of item names; a bare string raises `TypeError`, an unknown name raises `ValueError`, and naming more than one item requires `multiple=True`. Readers can still open and close items.
**Not in Stage 9 execution logs:** keep the canonical `mo.accordion({"Execution Log (<file>.py)": mo.md(...)})` form exactly. `scripts/decompile_notebook.py` requires the execution-log accordion to have one positional mapping and no keyword arguments, so `expanded=`, `multiple=`, or `lazy=` there makes decompilation fail.
### 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.status.toast("Operation complete!")
# Lives under mo.status (there is no top-level mo.toast).
# Signature: toast(title, description=""); kind="danger" is the only non-default kind.
```
## 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 auto-detected from bytes (no format= parameter)
```
### 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: 322k | 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 |