Builds a horizontal row containing previous, value, and next controls. Items may be strings or { label, value } tables; the callback receives the original item.
Example
local modes = {
'Compact',
'Balanced',
'Verbose',
}
local selected = 2
ui.selector {
items = modes,
selected = selected,
onSelect = function(index, item)
selected = index
print('Mode:', item)
end,
}Parameters
| Field | Type | Description |
|---|---|---|
items | table | Strings or { label, value } entries. |
selected | integer? | Initial selected index. |
onSelect | function? | Receives the index and original item. |
emptyLabel | string? | Text shown when there are no items. |
buttonProps | table? | Properties for previous and next buttons. |
iconProps | table? | Properties for arrow icons. |
labelProps | table? | Properties for the selected value. |
labelTemplate | openmw.ui.Template? | Template for the selected value. |
Common layout fields are documented on the UI Components overview. Empty and one-item lists are valid and cannot move.