UI › LAYER
CONFIRM FLOW

Confirm flow

The promise resolves with { isConfirmed, isDismissed, dismiss }. This page shows how to chain a follow-up popup (success / info / error).

“Open error” shows the staggered X mark animation.
Example
JavaScript
HTML
CSS
xjs.layer({
  title: 'Delete item?',
  text: 'This action cannot be undone.',
  icon: 'warning',
  showCancelButton: true,
  confirmButtonText: 'Delete',
  cancelButtonText: 'Cancel'
}).then((res) => {
  if (res.isConfirmed) {
    xjs.layer({ title: 'Deleted', icon: 'success' });
  } else {
    xjs.layer({ title: 'Cancelled', icon: 'info' });
  }
});
<button class="btn danger">Open confirm</button>
/* Local styles for buttons only */
功能说明:验证 Layer 的 Promise 结果结构,以及多弹窗串联时的体验(warning → success/info)。
Previous
Next