MDK Logo
ReferenceUI KitReactUI Kit foundationComponentsSettings

ChangeConfirmationModal

Generic confirmation modal that shows a diff or summary of pending changes before applying them.

Generic confirmation modal that shows a diff or summary of pending changes before applying them.

import { ChangeConfirmationModal } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
openRequiredboolean
titleRequiredstring
onConfirmRequiredVoidFunction
onCloseRequiredVoidFunction
childrenRequiredReact.ReactNode
confirmTextOptionalstring | undefined
destructiveOptionalboolean | undefined

Usage

Generic confirmation dialog that presents a summary of pending changes before applying them. Supports both standard (primary) and destructive (danger) confirmation actions. The body content is passed as children, making it flexible enough to render diffs, item lists, or plain text.

Notes

  • Closing via the backdrop is disabled to prevent accidental dismissal.
  • Use destructive={true} any time the action is irreversible (delete, reset, revoke).
  • For non-destructive confirmations such as applying setting changes, omit destructive or set it to false.

Example

import { useState } from 'react'import { ChangeConfirmationModal } from '@tetherto/mdk-react-devkit'export const ChangeConfirmationModalExample = () => {  const [open, setOpen] = useState(false)  return (    <div className="mdk-example-row">      <button onClick={() => setOpen(true)}>Confirm Change</button>      <ChangeConfirmationModal        open={open}        title="Apply Configuration Changes?"        onConfirm={() => {          console.warn('confirmed')          setOpen(false)        }}        onClose={() => setOpen(false)}        confirmText="Apply"      >        This will update pool assignments for 12 devices.      </ChangeConfirmationModal>    </div>  )}