Props
open: booleanControls whether the confirmation dialog is open.
onConfirm: () => voidRuns when the confirm action is accepted.
onCancel: () => voidRuns when the dialog is dismissed or canceled.
title: stringPrimary confirmation prompt.
description?: stringOptional explanatory copy under the title.
confirmLabel?: stringOverride for the confirm button label.
cancelLabel?: stringOverride for the cancel button label.
variant?: 'default' | 'destructive'Switches the confirm action styling for risky operations.
children?: ReactNodeOptional extra content rendered under the description.
Example
ConfirmDialog.tsx
import { useState } from 'react';
import { ConfirmDialog, Button } from '@meteorack/sdk-react';
export function DeleteModuleAction() {
const [open, setOpen] = useState(false);
return (
<>
<Button variant="danger" onClick={() => setOpen(true)}>
Delete module
</Button>
<ConfirmDialog
open={open}
onCancel={() => setOpen(false)}
onConfirm={() => setOpen(false)}
title="Delete this module?"
description="This permanently removes the module configuration from the site."
confirmLabel="Delete"
cancelLabel="Keep module"
variant="destructive"
>
<p
style={{
marginTop: '12px',
fontSize: '13px',
color: 'var(--mck-text-2, #a1a1aa)',
}}
>
Export the configuration first if you might need it again later.
</p>
</ConfirmDialog>
</>
);
}