Skip to main content
Also has everything from ElementHandle. A vertical list. items are strings, or tables like { id, name?, icon? }. Value is the id of the selected item.
Value typestring? (selected id)
Itemsstring or ListItem
Created bySection:AddList

Creation

section:AddList(key, label, items?, default?)

SetItems

list:SetItems(items: { string | ListItem }): ()
Replace all items.

AddItem

list:AddItem(item: string | ListItem): ()

RemoveItem

list:RemoveItem(id: string): ()

SetSelected

list:SetSelected(id: string?): ()
Pass nil to clear.

GetSelected / GetSelectedItem

list:GetSelected(): string?
list:GetSelectedItem(): ListItem?
GetSelectedItem returns the full item table.

SetShowSearch

list:SetShowSearch(show: boolean): ()
Toggle the search field.

SetMaxHeight

list:SetMaxHeight(pixels: number): ()
Cap the scroll height.

SetEmptyText

list:SetEmptyText(text: string): ()
Shown when there are no items.

SetPlaceholder

list:SetPlaceholder(text: string): ()
Search field placeholder.

AddFilter

list:AddFilter(name: string, comparator: ((item: ListItem) -> boolean)?): ()
Filter which items the user sees. Without a comparator, the built-in default is used.

RemoveFilter

list:RemoveFilter(name: string): ()

SetFilter

list:SetFilter(name: string?): ()
Activate a filter by name. Pass nil to clear.

GetFilter

list:GetFilter(): string?

SetRenamable / IsRenamable

list:SetRenamable(renamable: boolean): ()
list:IsRenamable(): boolean
Let the user rename items in place.

OnRename

list:OnRename(callback: (id: string, newName: string) -> ()): () -> ()
Runs when the user commits a rename.

BeginEdit / CancelEdit / CommitEdit

list:BeginEdit(id: string): ()
list:CancelEdit(): ()
list:CommitEdit(newName: string): ()
Control inline renaming from code.