deeleeramone/pywry/modals
Claude Code and agent skill by deeleeramone/pywry
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install deeleeramone/pywry/modalsSKILL.md
Modals - MANDATORY PATTERN
STOP. READ THIS ENTIRE FILE BEFORE CREATING MODALS.
Overview
Modals are reusable overlay dialogs that can contain any content - forms, confirmations, information panels, or custom HTML. They follow the same pattern as toolbars, passed to .show-* functions.
The ONLY Correct Way to Create Modals
Copy this EXACTLY. Do not deviate.
THAT'S IT. Button click opens the modal automatically.
Modal Schema
| Property | Type | Required | Default | Description | |
|---|---|---|---|---|---|
component_id | str | YES | - | Unique identifier for the modal | |
title | str | no | "" | Modal header title | |
items | list[str] | no | [] | HTML content strings | |
size | str | no | "medium" | "small", "medium", "large", "fullscreen" | |
width | str | no | None | Custom width (e.g., "600px", "80%") | |
max_height | str | no | None | Custom max-height (e.g., "400px") | |
overlay_opacity | float | no | 0.5 | Backdrop opacity (0.0-1.0) | |
close_on_escape | bool | no | True | Close when Escape key pressed | |
close_on_overlay_click | bool | no | True | Close when clicking outside modal | |
reset_on_close | bool | no | True | Reset form inputs when closed | |
on_close_event | str | no | None | Event to emit when modal closes | |
open_on_load | bool | no | False | Open modal immediately on page load | |
style | str | no | "" | Additional CSS for this modal | |
script | str | no | "" | Additional JavaScript for this modal | |
class_name | str | no | "" | Additional CSS classes |
Size Presets
| Size | Width | Use Case | |
|---|---|---|---|
small | 320px | Confirmations, alerts | |
medium | 500px | Forms, settings (default) | |
large | 720px | Complex forms, tables | |
fullscreen | 95vw / 95vh | Data grids, large content |
Modal Events
These are the ONLY events that work with modals:
Opening and Closing
| Event Type | Description | |
|---|---|---|
modal:open:<component_id> | Opens the modal | |
modal:close:<component_id> | Closes the modal | |
modal:toggle:<component_id> | Toggles open/closed state |
Example: Button to Open Modal
Example: Button Inside Modal to Close
Built-in Close Behaviors
- X Button: Every modal has a close button in the top-right corner
- Escape Key: Press Escape to close (unless
close_on_escape=False) - Overlay Click: Click outside modal to close (unless
close_on_overlay_click=False)
reset_on_close Behavior
When reset_on_close=True (default):
- All
<input>,<textarea>,<select>elements are reset to their initial values - Form state is cleared when modal closes
- Next open shows fresh form
When reset_on_close=False:
- Form values persist between opens
- User can resume where they left off
JavaScript API
Access modal functions via window.pywry.modal:
Complete Examples
1. Settings Modal with Form
2. Confirmation Dialog
3. Modal with Custom Styling
4. Modal with Custom JavaScript
CSS Selectors for Styling
Target modal elements with these selectors:
| Selector | Element | |
|---|---|---|
#<component_id> | The modal overlay | |
#<component_id> .pywry-modal-container | The modal box | |
#<component_id> .pywry-modal-header | Header with title and close button | |
#<component_id> .pywry-modal-title | Title text | |
#<component_id> .pywry-modal-close | X close button | |
#<component_id> .pywry-modal-body | Content area | |
#<component_id> .pywry-modal-footer | Footer area (if you add one) |
Theme Awareness
Modals automatically inherit the current theme:
.pywry-theme-dark→ Dark background, light text.pywry-theme-light→ Light background, dark text.pywry-theme-system→ Follows OS preference
Use CSS variables for consistent theming:
Common Mistakes
❌ Wrong: event: "open-modal" (missing modal: prefix and component_id) ❌ Wrong: event: "modal:open" (missing component_id) ❌ Wrong: Using onclick without window.pywry.modal. prefix
✅ Correct: event: "modal:open:my-modal" ✅ Correct: onclick="window.pywry.modal.close('my-modal')"
Dict Syntax (Alternative to Modal Class)
You can also use dict syntax if preferred:
Integration with Toolbars
Modals and toolbars work together seamlessly:
Security
- Security scanPassed, 100 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 repositoryCheckingpywry/pywry/mcp/skills/modals/SKILL.md
Popularity
- Repository stars
- 89
- Repository forks
- 7
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/deeleeramone/pywry/modals)