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 VB-1042 for $4,855.00?
Opening and closing
- Call
show()or set theopenattribute to open the dialog. - Call
close(returnValue)to close it. - Any element inside the dialog with
data-closecloses it. The attribute value becomes thereturnValue. An emptydata-closegivesdismiss.
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.
<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.
<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.
| Option | Default |
|---|---|
heading | Are you sure? |
message | empty |
confirmLabel | Confirm |
cancelLabel | Cancel |
tone | primary (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
Date picker
A date field with a calendar, built into nsui-input.
Facts
Read-only figures, as a detail column or a totals summary.
NSUI is a community project. It is not an official Oracle NetSuite product. NetSuite is a trademark of Oracle.