Use modal when users must confirm or complete a focused task before proceeding.
Modal
Dialog surface for focused tasks that require temporary context isolation.
- .source-modal Native dialog root
- .source-modal-header Header row with title and close action
- .source-modal-close Close control button
- .source-modal-body Scrollable content section
- .source-modal-footer Optional action row
Sizes
Structure variants
Design intent
Modal blocks everything else to focus the user on one task. It earns its place when that task requires temporary isolation from the rest of the page: a destructive confirmation, a short data-entry flow, or content that would break reading context if inline. Avoid it for navigation, long forms, or decisions that could be a toast.
Icon sizing
Close icon should be at least 16px and centered in a minimum 32px hit area. Keep the close affordance visually aligned with header typography.
Do and don't
State what happens when users confirm, cancel, or close.
Keep primary and secondary actions explicit and ordered by risk.
Do not open modals for lightweight status updates. Use Toast or inline feedback.
Avoid opening a second modal on top of another modal.
Never hide destructive consequences behind vague labels like "Continue".
Designer checklist
- Title accurately describes the task, not just the component name.
- Cancel is always available alongside destructive primary actions.
- Modal does not auto-close on backdrop click for destructive or data-entry flows.
- Focus returns to the trigger element that opened the modal after close.
- Nothing critical is hidden behind a second modal layer.