Read page as text

NIB / DOCUMENTATION

Select — NibComponents

Choose from a fixed list, grouped or searchable.

Open interactive view

Keep labels separate from stored values

Provide exactly one of options or groups. NibSelectOption<T> contains value, label, optional subtitle and icon, and disabled. NibSelectGroup<T> adds a section label and a list of options. Disabled rows remain visible and cannot be chosen. The label is displayed; callbacks return the typed value.

Choose initial state or own a controller

value and values seed only an internally created controller on first build. With controller supplied, that controller is the source of truth and those initial values are ignored. NibSelectController exposes selectedValue, selectedValues, isOpen, selectOnly, toggle, setSelection, clear, open, and close. Dispose only the controller you create; do not replace it during style changes.

Handle one or many selections

onChanged is the single-value convenience callback and may emit null when cleared. onSelectionChanged returns the full list in either mode. multiSelect keeps the dropdown open and toggles items. clearable adds a trailing clear affordance. The preview also offers an explicit controller-driven Clear selection button.

Choose a preset or supply an entrance pose

animated defaults to false. When enabled, animation accepts none, fade, slide, scale, fadeScale, or slideFade. transition controls timing separately, while enterFrom supplies an explicit NibAnim and overrides the preset. resolveNibSelectEnter(animation, openUp: ...) returns the direction-aware initial pose. staggerOptions separately staggers rows through NibMotionList.

Operate the dropdown inside its host

The dropdown uses the nearest Overlay, flips when space is limited, and constrains its height. Arrow keys move among enabled results; Enter chooses and Escape closes. Give semanticLabel to the trigger. maxDropdownHeight defaults to 280; it is a ceiling, not a promise that every local preview has that much room.

An external value did not update the selection

Changing value after mount does not control this widget. Use the same external controller and call selectOnly or setSelection instead. Supplying both groups and options asserts. Empty search results do not mean the underlying list changed; clear the query or inspect the custom matcher.