Skip to main content

MultinaireDialog

Confirmation and alert dialog with multiple types and customizable actions.

Basic Usage

import { MultinaireDialog } from '@multinaire/multinaire-design';

<MultinaireDialog
message="Are you sure you want to delete this item?"
buttonTitle="Delete"
cancelButtonTitle="Cancel"
onPress={() => handleDelete()}
/>

Props

PropTypeDefaultDescription
messagestringMain body message of the dialog
type'alert' | 'confirm' | 'banner''confirm'Visual style of the dialog
iconIconNameIcon displayed at the top of the dialog
destructivebooleanfalseRender the primary action button with a destructive (error) style
buttonTitlestringLabel for the primary action button
cancelButtonTitlestringLabel for the cancel button (used when type="confirm")
isLoadingbooleanfalseShow a loading state inside the dialog
onPress() => voidCallback invoked when the primary action button is pressed

Examples

Alert Dialog

<MultinaireDialog
type="alert"
icon="AlertCircle"
message="Your session has expired. Please log in again."
buttonTitle="OK"
onPress={() => navigation.navigate('Login')}
/>

Confirmation Dialog

<MultinaireDialog
type="confirm"
message="Are you sure you want to save these changes?"
buttonTitle="Save"
cancelButtonTitle="Cancel"
onPress={() => saveChanges()}
/>

Destructive Confirmation

<MultinaireDialog
type="confirm"
destructive
icon="Trash"
message="This action cannot be undone. Are you sure you want to delete this item?"
buttonTitle="Delete"
cancelButtonTitle="Cancel"
onPress={() => deleteItem()}
/>
<MultinaireDialog
type="banner"
icon="Gift"
message="You've earned a reward! Tap to claim your prize."
buttonTitle="Claim Now"
onPress={() => claimReward()}
/>

With Loading State

<MultinaireDialog
message="Confirm your purchase?"
buttonTitle="Buy Now"
cancelButtonTitle="Cancel"
isLoading={isPurchasing}
onPress={() => completePurchase()}
/>

Sign Out Confirmation

<MultinaireDialog
type="confirm"
icon="Logout"
message="Are you sure you want to sign out?"
buttonTitle="Sign Out"
cancelButtonTitle="Cancel"
onPress={() => signOut()}
/>