Select
Select is a Tree component that collects user-provided information from a list of options.

Usage Example
local signal = n.create_signal({
selected = { "poland" }
})
n.select({
border_label = "Select countries",
selected = signal.selected,
data = {
n.separator("Europe"),
n.option("Poland", { id = "poland" }),
n.option("Spain", { id = "spain" }),
n.option("Portugal", { id = "portugal" }),
n.option("France", { id = "france" }),
n.option("Germany", { id = "germany" }),
n.separator("North America"),
n.option("USA", { id = "usa" }),
n.option("Canada", { id = "canada" }),
},
multiselect = true,
on_select = function(nodes)
signal.selected = nodes
end,
})Properties
data
Type
NuiTreeNode[]multiselect
Default value
falseType
booleanselected
If multiselect is set to true:
Type
string[] | NuiTreeNode[]Otherwise:
Type
string | NuiTreeNodeon_select
If multiselect is set to true:
Type
fun(selected: NuiTreeNode[], component: Select): nilOtherwise:
Type
fun(selected: NuiTreeNode, component: Select): nilprepare_node
Type
fun(is_selected: boolean, node: NuiTreeNode, component: Select): NuiLineshould_skip_item
Type
fun(node: NuiTreeNode, is_separator: boolean): NuiLineHighlight Groups
NuiComponentsSelectOptionNuiComponentsSelectOptionSelectedNuiComponentsSelectSeparatorNuiComponentsSelectNodeFocused