Skip to Content
NSUI

Dialog

Modal dialog with a heading, body and footer.

Use a dialog to ask for a decision or show a short form on top of the page. It uses the native <dialog> top layer, so NetSuite z-index and overflow rules cannot clip it.

Approve bill

Approve VB-1042 for $4,855.00?

CancelApprove

Opening and closing

  • Call show() or set the open attribute to open the dialog.
  • Call close(returnValue) to close it.
  • Any element inside the dialog with data-close closes it. The attribute value becomes the returnValue. An empty data-close gives dismiss.

The close event fires with event.detail.returnValue. Escape, a backdrop click and the close button give dismiss.

Not dismissable

Set dismissable="false" to hide the close button and ignore Escape and backdrop clicks. The user must then use a footer button.

HTML
<nsui-dialog heading="Posting period closed" dismissable="false" open>
  <p>Choose an open period to continue.</p>
  <nsui-button slot="footer" variant="primary" data-close="ok">OK</nsui-button>
</nsui-dialog>

Width

The dialog is 520px wide. Set --nsui-dialog-width to change it. The width never exceeds the window width minus 32px.

HTML
<nsui-dialog heading="Edit address" style="--nsui-dialog-width: 720px">...</nsui-dialog>

confirm()

confirm() opens a dialog with Cancel and confirm buttons. It returns a promise that resolves to true when the user confirms, and to false on Cancel or a dismiss. tone: 'danger' makes the confirm button red.

Delete line
OptionDefault
headingAre you sure?
messageempty
confirmLabelConfirm
cancelLabelCancel
toneprimary (danger for a red button)

With the ES module build, import it: import { confirm } from 'nsui';.

API

Attributes

Prop

Type

Events

Prop

Type

Slots

Prop

Type

CSS parts

Prop

Type

CSS custom properties

Prop

Type

NSUI is a community project. It is not an official Oracle NetSuite product. NetSuite is a trademark of Oracle.

On this page