| name | potato:creating-modals |
| description | Use when creating or modifying modal dialogs in the web-react application |
Creating Modals in Potato Cannon
This skill documents the correct patterns for creating modal dialogs in the web-react application.
Base Components
All modals use the Radix UI-based Dialog components from @/components/ui/dialog:
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
Theme Variables
The dialog component uses the project's theme variables by default:
- Background:
bg-bg-secondary
- Border:
border-border
- Title text:
text-text-primary
- Description text:
text-text-secondary
These are baked into the base DialogContent, DialogTitle, and DialogDescription components, so you typically don't need to override them.
Basic Modal Structure
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogContent>
<>
Modal Title
Description text explaining what this modal does.
{/* Modal body content */}
{/* Form fields, content, etc. */}
setIsOpen(false)}>
Cancel
Confirm
</>