param087/saas-ui-skills/modals-and-dialogs

Claude Code and agent skill by param087/saas-ui-skills

Trust tier 3
  • community
Source check pending

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-dialogs

SKILL.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

UsePrimitiveWhen
Centered modalDialogShort forms, focused tasks
Side panelSheetDetails, filters, edit alongside context
Bottom drawerDrawer (vaul)Mobile-friendly, touch dismiss
Confirm/destructAlertDialogYes/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:

tsx
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="destructive">Delete project</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete this project?</AlertDialogTitle>
<AlertDialogDescription>
This permanently deletes the project and all its data. This can’t be undone.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
onClick={deleteProject}
>
Delete
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>

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:

tsx
const [open, setOpen] = React.useState(false);
async function onSubmit(values) {
await save(values); // throws → dialog stays open, error shows
setOpen(false); // success → close
toast.success("Saved");
}
<Dialog open={open} onOpenChange={setOpen}>…</Dialog>

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 back aria-labelledby/describedby. Visually hide the title with sr-only if 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 Sheet or 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/param087/saas-ui-skills/modals-and-dialogs/badge)](https://verified-skill.com/skills/param087/saas-ui-skills/modals-and-dialogs)

Something wrong with this skill or its page? Tell us.