Mobile › Overlays
Dialog
Asks the person to confirm before something they can't undo. Up to three buttons.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { Dialog } from "plankui-mobile";
<Dialog
open={open}
onClose={() => setOpen(false)}
title="Delete project?"
message="This removes the project and its 12 screens. You can't undo this."
buttons={[
{ label: "Cancel", style: "cancel" },
{ label: "Delete", style: "destructive", onPress: remove },
]}
/>iOS and Android
iOS: A centred alert with stacked or side-by-side buttons, the cancel button bold.
Android: A Material 3 dialog with text buttons at the bottom right.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | Whether it shows. | |
| onClose | () => void | Called when it closes. | |
| title | string | The question. | |
| message | string | – | What will happen. |
| buttons | { label; onPress?; style?: "default" | "cancel" | "destructive" }[] | Up to three. Put cancel first; it lands where each platform expects. |