ConfirmDialog
A promise-based yes/no dialog with the same options as the web useConfirm. Mount ConfirmDialogProvider once inside the theme provider; await confirm({...}) resolves true or false.
Examples
Loading examples…
API
From COMPONENTS.md; setup for every native component is on React Native.
| Component | Notes |
|---|---|
ConfirmDialogProvider / useConfirm |
Promise-based yes/no dialog — same options as web useConfirm. Mount once inside NativeThemeProvider. |
Same options and hook as the web ConfirmDialog. confirm() resolves true on confirm, false on cancel, scrim tap or back.
import { ConfirmDialogProvider, useConfirm } from 'achery-ui/native'
// Once, inside NativeThemeProvider
<ConfirmDialogProvider><App /></ConfirmDialogProvider>
const confirm = useConfirm()
const ok = await confirm({
title: 'Delete task?',
message: "This can't be undone.",
confirmLabel: 'Delete',
destructive: true,
})
| Option | Type | Default |
|---|---|---|
title |
ReactNode |
— |
message |
ReactNode |
required |
confirmLabel |
string |
'Confirm' |
confirmVariant |
'accent' | 'secondary' | 'ghost' |
'accent' (ignored when destructive) |
cancelLabel |
string |
'Cancel' |
destructive |
boolean |
false — confirm button uses the danger variant |