anywidget-generator

Generate and wrap vanilla JavaScript anywidget components for Marimo notebooks.

1|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/IndianBoy42/dot-opencode --skill anywidget-generator-indianboy42
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: anywidget-generator
Source: https://github.com/IndianBoy42/dot-opencode/tree/main/skills/anywidget-generator
Command: npx skills add https://github.com/IndianBoy42/dot-opencode --skill anywidget-generator-indianboy42

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Produces and wraps vanilla JavaScript anywidget components for Marimo notebooks, reducing boilerplate and accelerating UI experimentation.

Core Features & Use Cases

  • Generate and wrap vanilla JS anywidget widgets for Marimo notebooks using optional external _esm and _css files via pathlib.
  • Enforce wrapping with marimo: widget = mo.ui.anywidget(OriginalAnywidget()) to ensure consistent display.
  • Provide best-practices guidance for styling, packaging, and sharing widgets with minimal setup.

Quick Start

Create a minimal anywidget class in _esm with a render function, wrap it with mo.ui.anywidget, and render it in a Marimo notebook.

Frequently Asked Questions about anywidget-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom JavaScript widgets for Marimo notebooks?

You can create custom JavaScript widgets for Marimo notebooks by defining an anywidget class with a render function in an _esm file, then wrapping it with mo.ui.anywidget to ensure proper interactive display within the notebook.

What is the best way to reduce boilerplate when building anywidget components?

The best way to reduce boilerplate when building anywidget components is to use a generator that scaffolds the vanilla JavaScript class structure, handles pathlib references for external _esm and _css files, and automatically enforces mo.ui.anywidget wrapping.

Can I use external CSS and JavaScript files with anywidget in Marimo?

Yes, you can use external CSS and JavaScript files with anywidget in Marimo. The component supports optional external _esm and _css files loaded via pathlib, allowing you to separate styling and rendering logic from the main widget definition.

How do I wrap an anywidget class so it renders correctly in a Marimo notebook?

To wrap an anywidget class so it renders correctly in a Marimo notebook, instantiate your custom widget and pass it directly to marimo's UI wrapper: widget = mo.ui.anywidget(OriginalAnywidget()). This enforces consistent display and interactivity.

Does the anywidget wrapper for Marimo support optional scripts and reference assets?

Yes, the anywidget wrapper for Marimo supports optional scripts, references, and assets. It relies on YAML frontmatter in SKILL.md for configuration and allows you to extend widget functionality by including additional resources.

Why is my custom anywidget not displaying properly in a Marimo notebook?

Your custom anywidget might not display properly in a Marimo notebook if you skip the required wrapping step. You must enforce wrapping by passing the instantiated widget through mo.ui.anywidget to ensure consistent rendering and state management.