Skip to content
S3ctor’s S3cret St4sh
api

tabs

Build a selectable tab strip without owning page content.

Builds a horizontal row of buttons. The selected tab gets its selected button and label properties plus the default [ label ] decoration. It does not create, hide, or update page content.

Example

local pages = {
  'General',
  'Advanced',
}
local page = ui.text {
  text = pages[1],
}

ui.column {
  children = {
    ui.tabs {
      items = pages,
      onSelect = function(_, label)
        page.props.text = 'Showing ' .. label
      end,
    },
    page,
  },
}

Parameters

FieldTypeDescription
itemstableTab labels or value entries.
selectedinteger?Initial selected index.
onSelectfunction?Receives the index and selected item.
buttonPropstable?Base button properties.
selectedPropstable?Properties merged onto the selected button.
labelPropstable?Base label properties.
selectedLabelPropstable?Properties merged onto the selected label.
selectedPrefixstring?Prefix for the selected label.
selectedSuffixstring?Suffix for the selected label.

Common layout fields are documented on the UI Components overview. Page content and durable selection remain caller-owned.

See also

selector · button · window