Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Modal System
Goal
Unify all product dialogs in GrantMaster on one interaction model and one visual system.- One low-level foundation:
src/components/ui/dialog.tsx - One compatibility wrapper:
src/components/ui/Modal.tsx - One product-level modal system:
src/components/ui/modal-system/AppModal.tsx
Public Components
AppModalAppDrawer(bottom sheet on mobile, side panel on desktop)ModalHeaderModalTitleModalDescriptionModalBodyModalFooterModalNoticeModalMetaListModalCheckboxFieldConfirmDialogDecisionDialogReviewDialogActionListDialogDrawerFooterDrawerCloseFooter
When To Use What
- Use
ConfirmDialogfor irreversible or destructive actions. - Use
DecisionDialogfor 2-3 mutually exclusive outcomes. - Use
ReviewDialogfor inspect-then-decide flows with richer body content. - Use
ActionListDialogfor user/admin action menus. - Use
AppDrawerfor detail views, settings panels, and inspect flows on mobile (bottom sheet) and desktop (side panel). Preferred overAppModalwhen content is read-heavy or the user needs to reference the page behind. - Use
AppModalfor standard forms and detail views that do not fit the patterns above. - Use legacy
Modalonly when migrating existing code incrementally.
Drawer Variant
TheAppDrawer component renders as a bottom sheet on mobile and a side panel (right-aligned, 28rem) on desktop. It integrates with the declarative modal pipeline via variant: 'drawer' in ModalDef.
- Drag handle on mobile (visual affordance for swipe)
- Responsive layout: bottom sheet below
lgbreakpoint, side panel above - Same glass-frosted backdrop as
AppModal - Automatic focus trapping and scroll locking via Radix Dialog
Sizes
sm: short confirmations, single-field dialogsmd: standard forms and install flowslg: review flows and denser detail viewsxl: large forms or multi-section content2xl: rare legacy compatibility surfacefull: only for workflows that genuinely need near-full-viewport width
Header Rules
- Optional icon on the left
- Required title for product dialogs
- Optional short description under the title
- Close button always in the top-right
Footer Rules
- Primary action rightmost
- Secondary action immediately to its left
Cancelwhen abandoning an editable or confirmable flowClosewhen the dialog is passive or already completed- Destructive actions use
destructive - Success/approve actions use
success
Copy Rules
- Prefer short verbs:
Save Role,Accept,Reject,Revoke Access,Install Module - Avoid vague labels such as
Confirmunless the action is generic - Keep descriptions short and operational
- Put longer risk explanation in
ModalNotice, not the title
Accessibility Rules
- All dialogs must expose a title
- All dialogs must expose a description or a hidden fallback description
- ESC closes only when
dismissibleis true - Outside click closes only when
dismissibleis true - Focus returns to the trigger through Radix dialog behavior
- Loading states must disable conflicting actions
Pattern Examples
Confirm Dialog
Review Dialog
Action List Dialog
Migration Rules
- New product dialogs should import from
@/components/ui/modal-system - Do not add new product flows directly on
DialogContent - Do not add new confirm flows through
alert-dialogor bespoke hooks - Keep domain logic in feature components; keep layout and interaction rules in the modal system