Alert Dialog
Confirmation dialog with explicit Cancel/Action composition and no backdrop dismissal.
Install
First install? Set up the registry in your app.
npx --yes --package=https://native.uipkge.dev/cli/uipkge-native-0.1.1.tgz uipkge-native add alert-dialogSource files
Expand a file to read the source the installer copies into your app.
components/ui/alert-dialog/AlertDialog.tsx
import * as React from 'react'
import { View } from 'react-native'
import { DialogContent, type DialogContentProps } from '@/components/ui/dialog'
export {
Dialog as AlertDialog,
DialogTrigger as AlertDialogTrigger,
DialogClose as AlertDialogCancel,
DialogClose as AlertDialogAction,
} from '@/components/ui/dialog'
export type { DialogProps as AlertDialogProps } from '@/components/ui/dialog'
export type AlertDialogContentProps = Omit<DialogContentProps, 'dismissOnBackdropPress' | 'accessibilityRole'>
export const AlertDialogContent = React.forwardRef<React.ComponentRef<typeof View>, AlertDialogContentProps>(
(props, ref) => <DialogContent ref={ref} {...props} dismissOnBackdropPress={false} accessibilityRole="alert" />,
)
AlertDialogContent.displayName = 'AlertDialogContent'
components/ui/alert-dialog/index.ts
export * from './AlertDialog'