Create a set of tabs

Step 1: add a ‘tabs’ widget to the page

// anchor: custom-imports: start
var Tabs = require("nsx/tabs");
// anchor: custom-imports: end
// anchor: custom-page-after: start
var tabs = page.defineTabs({
  selector: "details" // inject the tabs widget into the "details" segment
});
// anchor: custom-page-after: end

Step 2: define your tabs in a number of functions

function defineHelloWorldTab(tabs) {
  // Define a viewModel for your popup
  var viewModel = {
    greeting: "Hello World!"
  }

  // Define the tab
  tabs.defineTab({
    name: "hello",
    view: "test/helloWorld",
    viewModel: viewModel
  })
}

Step 3: call your function

// anchor: custom-page-after: start
var tabs = page.defineTabs({
  selector: "details"
});
defineHelloWorldTab(tabs);
// anchor: custom-page-after: end