LWC LightningConfirm

メモ:

import LightningConfirm from ‘lightning/confirm’;

        const result = await LightningConfirm.open({

            message: ‘テンプレートの内容を上書き保存してよろしいですか。’,

            //variant: ‘header’,

            label: ‘確認’,

            theme: ‘inverse’,

        });

theme

  • default: white
  • shade: gray
  • inverse: dark blue
  • alt-inverse: darker blue
  • success: green
  • info: gray-ish blue
  • warning: yellow
  • error: red
  • offline: ​black​

その他

alert

import LightningAlert from 'lightning/alert';
async handleAlertClick() {
        await LightningAlert.open({
            message: 'this is the alert message',
            theme: 'error', // a red theme intended for error states
            label: 'Error!', // this is the header text
        });
        //Alert has been closed
}

https://developer.salesforce.com/docs/component-library/bundle/lightning-alert/documentation