AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Anywidget Generator

skill-marimo-team-skills-anywidget · by marimo-team

Generate anywidget components for marimo notebooks.

No reviews yet
0 installs
37 views
0.0% view→install

Install

$ agentstack add skill-marimo-team-skills-anywidget

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access Used
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-marimo-team-skills-anywidget)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Anywidget Generator? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

When writing an anywidget use vanilla javascript in _esm and do not forget about _css. The css should look bespoke in light mode and dark mode. Keep the css small unless explicitly asked to go the extra mile. When you display the widget it must be wrapped via widget = mo.ui.anywidget(OriginalAnywidget()). You can also point _esm and _css to external files if needed using pathlib. This makes sense if the widget does a lot of elaborate JavaScript or CSS.

import anywidget import traitlets

class CounterWidget(anywidget.AnyWidget): esm = """ // Define the main render function function render({ model, el }) { let count = () => model.get("number"); let btn = document.createElement("b8utton"); btn.innerHTML = count is ${count()}; btn.addEventListener("click", () => { model.set("number", count() + 1); model.savechanges(); }); model.on("change:number", () => { btn.innerHTML = count is ${count()}; }); el.appendChild(btn); } // Important! We must export at the bottom here! export default { render }; """ _css = """button{ font-size: 14px; }""" number = traitlets.Int(0).tag(sync=True)

widget = mo.ui.anywidget(CounterWidget()) widget

Grabbing the widget from another cell, .value is a dictionary.

print(widget.value["number"])

The above is a minimal example that could work for a simple counter widget. In general the widget can become much larger because of all the JavaScript and CSS required. Unless the widget is dead simple, you should consider using external files for _esm and _css using pathlib.

When sharing the anywidget, keep the example minimal. No need to combine it with marimo ui elements unless explicitly stated to do so.

Best Practices

Unless specifically told otherwise, assume the following:

  1. Use vanilla JavaScript in _esm:
  • Define a render function that takes { model, el } as parameters
  • Use model.get() to read trait values
  • Use model.set() and model.save_changes() to update traits
  • Listen to changes with model.on("change:traitname", callback)
  • Export default with export default { render }; at the bottom
  • All widgets inherit from anywidget.AnyWidget, so widget.observe(handler)

remains the standard way to react to state changes.

  • Python constructors tend to validate bounds, lengths, or choice counts; let the

raised ValueError/TraitError guide you instead of duplicating the logic.

  1. Include _css styling:
  • Keep CSS minimal unless explicitly asked for more
  • Make it look bespoke in both light and dark mode
  • Use CSS media query for dark mode: @media (prefers-color-scheme: dark) { ... }
  1. Wrap the widget for display:
  • Always wrap with marimo: widget = mo.ui.anywidget(OriginalAnywidget())
  • Access values via widget.value which returns a dictionary
  1. Keep examples minimal:
  • Add a marimo notebook that highlights the core utility
  • Show basic usage only
  • Don't combine with other marimo UI elements unless explicitly requested
  1. External file paths: When using pathlib for external _esm/_css files, keep paths relative to the project directory, consider using Path(__file__) for this. Do not read files outside the project (e.g., ~/.ssh, ~/.env, /etc/) or embed their contents in widget output.

Dumber is better. Prefer obvious, direct code over clever abstractions—someone new to the project should be able to read the code top-to-bottom and grok it without needing to look up framework magic or trace through indirection.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.