marcskovmadsen/holoviz-mcp/panel-custom-components
Claude Code and agent skill by marcskovmadsen/holoviz-mcp
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Build custom Panel components using JSComponent (vanilla JS, web components), ReactComponent (React/JSX), AnyWidgetComponent (AnyWidget spec for cross-platform), or MaterialUIComponent (Material UI themed). Use when wrapping JS libraries, creating interactive widgets, or building themed components. Includes decision guide, best practices, DOs/DON'Ts, and Playwright UI testing patterns.
Install
npx vskill@latest install marcskovmadsen/holoviz-mcp/panel-custom-componentsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Panel Custom Components
This skill covers building custom Panel components that bridge Python and JavaScript. Use it when you need to:
- Wrap JavaScript libraries (D3, Leaflet, Chart.js, etc.)
- Create interactive widgets with custom UI behavior
- Create Material UI themed components for
panel-material-uiapps
Prerequisites: Solid JavaScript and React knowledge assumed.
1. Decision Guide - Which Component Type to Use
Comparison Table
| Criteria | JSComponent | ReactComponent | AnyWidgetComponent | MaterialUIComponent | |
|---|---|---|---|---|---|
| Best For | Vanilla JS libs, Web Components, D3, Leaflet, simple widgets | React ecosystem, complex state, MUI/Chakra libs | Cross-platform (Jupyter+Panel), community sharing | panel-material-ui apps, MUI theming | |
| JS Pattern | DOM manipulation | React/JSX | AnyWidget AFM spec | React/JSX + MUI | |
| State Sync | model.on('param', cb) | model.useState("param") | model.get/set/save_changes | model.useState("param") | |
| Export | export function render({model, el}) | export function render({model, el}) | export default { render } | export function render({model, el}) | |
| Base Import | panel.custom.JSComponent | panel.custom.ReactComponent | panel.custom.AnyWidgetComponent | panel_material_ui.MaterialUIComponent |
Decision Flow
2. Development Workflow
Important: Build custom components in two phases. By experience, getting JS imports and responsive sizing to work can take significant debugging effort.
Phase 1: POC (Proof of Concept)
Before building the full component, create a minimal example using your actual target library that validates:
- JS imports work - The library loads without "Unexpected token 'export'" or CORS errors
- Library renders something - You can see actual output from the library (a chart, a map, a widget, etc.)
- Python-JS connection works - State syncs bidirectionally via
model.on()/model.useState() - Element displays responsively - Component fills container and handles resize events
The goal is to see your library working in a Panel component before investing time in the full implementation. Use the template below as a starting point, but replace the placeholder library with your actual library and render something real from it.
Minimal POC template:
ALWAYS test the UI via Playwright smoke tests! (see details below)
POC validation checklist:
- [ ] No console errors (especially import/CORS errors)
- [ ] Library object logs correctly in console
- [ ] Library renders visible output (chart, map, widget, etc.)
- [ ] Changing
poc.value = "New"updates the display - [ ] Component has non-zero dimensions
- [ ] Resize events fire when browser window changes
Phase 2: Finalize
Once the POC validates all three concerns, build out the full component:
- Add all parameters and their JS sync handlers
- Implement the full library integration
- Add error handling and edge cases
- Add CSS styling via
_stylesheets
3. Core Patterns (All Component Types)
Python Class Structure
All custom components inherit from a base class and use param for state:
ESM Export Pattern
All component types export a render function:
Import Maps for CDN Dependencies
Child and Children Parameters
Nest Panel components inside custom components:
Event Handling
JavaScript → Python:
Python → JavaScript:
4. JSComponent Patterns
JSComponent is the foundation for building custom Panel components with vanilla JavaScript. Use it for DOM manipulation, Web Components, and wrapping libraries like D3, Leaflet, or Chart.js.
Basic Structure
State Synchronization
Reading and Writing Parameters:
Subscribing to Changes:
Lifecycle Hooks
External Libraries Example (D3)
4.1. Wrapping Third-Party Web Components
When wrapping existing web components, follow these patterns:
Custom Element Lifecycle
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/panel-custom-components/SKILL.md
Popularity
- Repository stars
- 30
- Repository forks
- 13
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 Apr 2026, 7 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/marcskovmadsen/holoviz-mcp/panel-custom-components)