AROYN UI LIBRARY / UI COMPONENTS

Multi-Dropdown

Select several options using the existing Dropdown in Multi mode.

Create Multi-Dropdown#

Select several options using the existing Dropdown in Multi mode.

The constructor returns a Dropdown handle. The snippet assumes section exists, as created in Quick start.

LUAU
local multi = section:CreateDropdown({
    Name = "Categories", Flag = "categories", Multi = true,
    Options = {"Seeds", "Pets", "Compost"}, Default = {"Pets"},
    Callback = function(values) print(table.concat(values, ", ")) end,
})

Arguments#

OptionTypeDefaultMeaning
Options{string}{}Ordered option list; copied.
MultibooleanfalseSet true for this component mode.
Default{string}?{}Initial copied selections when Multi=true.
Placeholderstring"Select an option"Empty-selection caption.
MaxVisibleOptionsinteger6Between 1 and 20; long lists scroll.
Callbackfunction({string})nilReceives an independent selected array in Options order.

Also accepts common options: Name, Description, Disabled and Callback; stateful controls additionally support Flag, Persist and Sensitive.

Manage state#

LUAU
multi:SetValue({"Compost", "Pets", "Pets", "Unknown"}, true)
-- GetValue() is {"Pets", "Compost"}: ordered, deduplicated, filtered.
local snapshot = multi:GetValue()
multi:Clear()

Returned methods#

MethodReturnsBehavior
GetValue(){string}Current {string} value. Returns an independent selected array in Options order.
SetValue(value, notify?)selfSilent by default; true calls Callback only after a changed normalized value.
SetDisabled(boolean)selfChanges user availability without discarding the value.
IsDisabled()booleanReads the requested disabled state.
Destroy()nilRemoves this control and its subscriptions; safe to repeat.
GetOptions(){string}Independent ordered copy.
SetOptions(options, notify?)selfReplaces options and normalizes selection.
Clear(notify?)selfClears to nil or {} for multi.
Open()selfRequests opening if input is available.
Close(instant?)selfCloses; instant defaults false.
IsOpen()booleanReads the logical popup state.

Behavior and limitations#

Options must be a dense array of nonempty strings. Duplicates are removed while preserving first occurrence order. Selection values are matched exactly, including case.

Only one Dropdown/ColorPicker popup can be open in a Window. Opening another closes the previous popup. Clicking the same trigger toggles genuinely closed/open; the outside handler excludes its trigger.

Placement uses available space. A popup below expands downward with its top anchored; above expands upward with its bottom anchored. Closing reverses toward the trigger, including interrupted tweens.

Outside mouse/touch, Escape, page switch, hide, minimize, disable and Destroy close the popup. Open() returning self does not guarantee that a blocked popup opened.

Multi selections keep the popup open for further choices. Empty selection is {}. There is no CreateMultiDropdown API.

GetValue, GetOptions and callback selection arrays are defensive copies. Removing an option removes it from the selection.

Default and SetValue accept nil or a dense array of strings; wrong types or holes assert. Unknown selections are discarded and duplicates collapse to one choice in Options order. SetOptions retains still-valid choices and reopens an already-open popup when available.