Skip to main content

Common Examples

To use the Dialog, pass the required title and content. Open it with an Anvil2 RN Button through trigger, or control it with isOpen and onOpenChange.

Actions

Pass primaryAction for the confirm action and secondaryAction for dismissal. The dialog fixes both buttons at medium size and fixes the secondary action to the secondary variant. The dialog closes after each footer press; the button’s own onPress fires first.
Use variant: "danger" on primaryAction for destructive confirmation.
Omit both actions for a footerless dialog. The header close still dismisses.

Open state

When you pass isOpen, onOpenChange is required so the header close, scrim, Android back, and footer actions can request a close.
Set isDismissable={false} to keep the scrim and Android back from closing the dialog. The header close still dismisses.

Accessibility

  • The required title is a heading that names the modal. The dialog sets accessibilityViewIsModal.
  • The header close control is a button named "Close" (English until the kit gains i18n).
  • Long content scrolls inside the surface.
Last modified on September 1, 2026