
Widgets
Render rich HTML inline via `<mcwidget>` tags with theme-aware styling.
Install
npx skills add kirodotdev/KiroCrew --skill widgets -g -a claude-code -y- Repository
- kirodotdev/KiroCrew4.7k
- Category
- Engineering
- Updated
- 3d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Render rich HTML inline via `<mcwidget>` tags with theme-aware styling. Load when emitting an mcwidget so the iframe inherits the dashboard theme instead of clashing with light / dark / custom palettes.
Inline widgets (<mcwidget>)
You can embed rich HTML in assistant messages using
<mcwidget title="Title">HTML</mcwidget>. The dashboard renders each tag as
a sandboxed iframe with Tailwind CSS preloaded. Use this for styled visual
content plain markdown cannot express: charts, color-coded tables, styled
cards, visual summaries, simple interactive probes.
Tailwind is preloaded and ready without any setup, it is served from the
dashboard's own origin, not from cdn.tailwindcss.com, which the iframe CSP
does NOT allow. Other libraries (Chart.js, D3, etc.) need a
<script src="…"> tag pulling from one of the CSP-allowed CDNs listed under
Rules below.
When to use
- Use when styled HTML genuinely helps comprehension, Chart.js graphs, color-coded comparison tables, status cards, before/after previews, small interactive probes.
- Don't use for content markdown already handles well, plain prose, bullet lists, fenced code, simple tables. Widget iframes cost more to render and add more context than markdown; default to markdown.
- Save to file for anything large.
<mcwidget>bodies fit comfortably up to a few KB; beyond that, write an HTML file and return the absolute path so the dashboard shows a thumbnail / link instead.
Theme-aware styling (critical)
The widget iframe inherits the dashboard's active theme through CSS custom properties injected into each srcdoc. Use these variables instead of hardcoded colors so widgets render correctly on every theme (light, dark, and user-defined custom palettes).
Core palette (use these first):
