param087/saas-ui-skills/modals-and-dialogs
Claude Code and agent skill by param087/saas-ui-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when building modals, sheets, drawers, or confirmation flows — choosing Dialog vs Sheet vs Drawer vs AlertDialog, focus trapping, destructive-action confirms, and forms inside overlays without losing data.
Install
npx vskill@latest install param087/saas-ui-skills/modals-and-dialogsSKILL.md
The same SKILL.md was published earlier as param087/saas-ui-skills/modals-and-dialogs.
Modals & Dialogs
Overview
Overlays interrupt — use them sparingly and correctly. shadcn/ui (on Radix) gives you four primitives with built-in focus trap, Esc to close, scroll lock, and aria-modal. Your job is choosing the right one and handling the edge cases: destructive confirms, forms with unsaved input, and not stacking overlays.
When to use
- A focused task or confirmation needs to block the page.
- Building a side panel for details/filters/quick-edit.
- A
<div>overlay is being hand-rolled (you'll miss focus trap + keyboard).
Pick the right primitive
| Use | Primitive | When | |
|---|---|---|---|
| Centered modal | Dialog | Short forms, focused tasks | |
| Side panel | Sheet | Details, filters, edit alongside context | |
| Bottom drawer | Drawer (vaul) | Mobile-friendly, touch dismiss | |
| Confirm/destruct | AlertDialog | Yes/no decisions; no dismiss-on-outside-click |
Destructive confirmation
AlertDialog (not Dialog) for irreversible actions — it requires an explicit choice and won't close on outside click or Esc accidentally losing the decision:
For high-risk deletes, require typing the resource name to enable the button.
Forms inside dialogs
Control open so you can keep the dialog open on validation error and close only on success:
Warn before discarding unsaved changes: intercept onOpenChange and confirm if the form isDirty.
Accessibility (mostly handled, don't break it)
- Always include
DialogTitle(+DialogDescription) — they backaria-labelledby/describedby. Visually hide the title withsr-onlyif needed, but keep it. - Focus moves into the dialog on open and returns to the trigger on close — don't disable this.
- Don't stack modals. Replace content or use a multi-step flow instead.
Pitfalls
- `Dialog` for destructive actions — outside-click dismiss can skip the decision; use
AlertDialog. - Closing on submit before the request resolves — close on success only.
- No unsaved-changes guard — users lose form input on accidental dismiss.
- Missing `DialogTitle` — breaks the accessible name; Radix will warn.
- Modal-on-modal stacking — confusing focus; redesign the flow.
- Putting huge content in a modal — use a
Sheetor a full page instead.
Hand-off
Overlays that host forms-and-validation, confirm data-tables row actions, and pair with notifications-and-toasts for post-action feedback.
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/modals-and-dialogs/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
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/param087/saas-ui-skills/modals-and-dialogs)