Overview
Edit profile
Update your display name and bio.
Ahmad Dani
🗑
Delete account?
All your data will be permanently deleted.
For simple yes/no confirmations, consider a compact
AlertDialog. Use Drawer or Sheet for side-panel interactions that don’t block the full screen.Installation
Usage
Variants
Default Modal
Standard dialog for forms or informational content.Edit profile
Update your display name and bio.
Ahmad Dani
Warning Modal
⚠
Unpublish page?
This page will no longer be visible to users.
Destructive Modal
Delete account?
All your data will be permanently deleted. This cannot be undone.
API Reference
Modal (Root)
boolean
Controls the open state.
(open: boolean) => void
Callback fired when the open state changes.
boolean
default:"false"
Uncontrolled default open state.
ModalContent
string
default:"md"
Dialog width. Values:
sm · md · lg · xl · fullReactNode
Icon shown in the header area alongside the title.
string
default:"default"
Icon container background. Values:
default · warning · destructivestring
Additional Tailwind classes for custom overrides.
ModalFooter
string
default:"end"
Button alignment inside the footer. Values:
start · end · betweenAccessibility
- Modal uses
role="dialog"witharia-modal="true" - Focus is trapped inside the modal while open
- Pressing Escape closes the modal
- Focus returns to the trigger element when the modal closes
ModalTitleis linked viaaria-labelledbyModalDescriptionis linked viaaria-describedby
Do’s & Don’ts
Do
- Use Modal for actions that require the user’s complete attention
- Keep modals focused on a single task
- Always provide a clear Cancel/Close action
- Use destructive
iconVariantfor irreversible actions
Don't
- Don’t use Modal for non-critical information — use Toast or Alert
- Don’t nest modals inside other modals
- Don’t make modals too large — keep content scannable
- Don’t auto-close a modal after a destructive action without confirmation