Skip to Content
NSUI

Getting started

Load NSUI in NetSuite or in any web page.

NSUI is one script file. Load it once, then use the nsui-* tags in your HTML.

In NetSuite

Copy dist/nsui.js into your own SDF project, next to the scripts that use it. Your project deploys it with everything else, so your users install nothing extra.

Project typeExample path
Account customization project (ACP)/SuiteScripts/<your-folder>/lib/nsui.js
SuiteApp/SuiteApps/<your-appid>/lib/nsui.js

Each project keeps its own copy, so you choose when to update it. To update, copy the new nsui.js over the old one and deploy.

Load it from a User Event beforeLoad through an INLINEHTML field, then add components bound to native fields:

JavaScript
/**
 * @NApiVersion 2.1
 * @NScriptType UserEventScript
 */
define(['N/ui/serverWidget', 'N/file'], (serverWidget, file) => {
  const NSUI_PATH = '/SuiteScripts/acme-orders/lib/nsui.js'; // your copy

  function beforeLoad(ctx) {
    const src = file.load({ id: NSUI_PATH }).url;
    const field = ctx.form.addField({ id: 'custpage_nsui', type: serverWidget.FieldType.INLINEHTML, label: ' ' });
    field.defaultValue = `
      <script src="${src}"></script>
      <nsui-select field="entity"></nsui-select>
      <nsui-input field="trandate"></nsui-input>`;
  }

  return { beforeLoad };
});

field="..." binds a control to a native body field. sublist="item" on nsui-data-grid binds the grid to a sublist. Saving the record works as usual, because the native fields submit.

Outside NetSuite

NSUI is not published to npm yet. Build it from the repository (npm run build), then import the ES module:

JavaScript
import './dist/nsui.esm.js';

Or load the plain script with a <script> tag:

HTML
<script src="nsui.js"></script>
<nsui-button variant="primary">Save</nsui-button>

Theming

NSUI's default font stack starts with "Oracle Sans", the font NetSuite pages load, then falls back to the system font. NSUI loads no font files.

This site does not load Oracle Sans, so the previews here use your system font. Inside NetSuite, the same components render in Oracle Sans.

Set any --nsui-* custom property on an ancestor:

CSS
:root {
  --nsui-accent: #0b5cad;
  --nsui-radius: 4px;
}

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

On this page