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
| Field | Type | Description |
|---|---|---|
items | table | Tab labels or value entries. |
selected | integer? | Initial selected index. |
onSelect | function? | Receives the index and selected item. |
buttonProps | table? | Base button properties. |
selectedProps | table? | Properties merged onto the selected button. |
labelProps | table? | Base label properties. |
selectedLabelProps | table? | Properties merged onto the selected label. |
selectedPrefix | string? | Prefix for the selected label. |
selectedSuffix | string? | Suffix for the selected label. |
Common layout fields are documented on the UI Components overview. Page content and durable selection remain caller-owned.