Overlays
Alert dialog
confirmations
function AlertDialogDemo() { return ( <AlertDialog> <AlertDialogTrigger asChild> <Button variant="destructive" className="w-full"> <Text>Delete account</Text> </Button> </AlertDialogTrigger> <AlertDialogContent> <AlertDialogHeader> <AlertDialogTitle>Delete your account?</AlertDialogTitle> <AlertDialogDescription> This cannot be undone. Your account and data will be permanently removed. </AlertDialogDescription> </AlertDialogHeader> <AlertDialogFooter> <AlertDialogCancel> <Text>Cancel</Text> </AlertDialogCancel> <AlertDialogAction className="bg-destructive"> <Text className="text-destructive-foreground">Delete account</Text> </AlertDialogAction> </AlertDialogFooter> </AlertDialogContent> </AlertDialog> );}API
<AlertDialog>…<AlertDialogCancel /><AlertDialogAction /></AlertDialog>Get it
Already in every copy of the native kit:
import { AlertDialog } from '@/components/ui/alert-dialog';Details
- Exports
AlertDialog- Packages
- @rn-primitives/alert-dialog@^1.5.2, react-native-reanimated@4.5.1, react-native-screens@~4.26.0
- Installs with
- @halftone-native/button, @halftone-native/lib-utils, @halftone-native/text, rnr/native-only-animated-view
- Also searched as
- confirm, destructive confirmation, are you sure
- Registry JSON
- /r/native/alert-dialog.json
<AlertDialog> <AlertDialogTrigger asChild> <Button variant="destructive">Delete project</Button> </AlertDialogTrigger> <AlertDialogContent> <AlertDialogHeader> <AlertDialogTitle>Delete “Website relaunch”?</AlertDialogTitle> <AlertDialogDescription>Its 24 tasks and files go too. This can’t be undone.</AlertDialogDescription> </AlertDialogHeader> <AlertDialogFooter> <AlertDialogCancel>Keep project</AlertDialogCancel> <AlertDialogAction>Delete project</AlertDialogAction> </AlertDialogFooter> </AlertDialogContent></AlertDialog>Usage
The confirm button says what happens (“Delete project”), never “OK”.
Get it
Already in every copy of the web kit:
import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogAction, AlertDialogCancel } from '@/components/ui/alert-dialog';Details
- Exports
AlertDialog,AlertDialogTrigger,AlertDialogContent,AlertDialogAction,AlertDialogCancel- Packages
- cn@^0.5.2, radix-ui@^1.7.0
- Installs with
- @halftone-web/button
- Also searched as
- confirm
- Registry JSON
- /r/web/alert-dialog.json
Agents: the whole registry is at /llms.txt.