Optional ReadonlybuttonsButtons shown in the picker's title bar. Build them with toPickButton
and handle presses with onTriggerButton.
Optional ReadonlyignoreKeep the picker open when focus moves elsewhere (default: false).
Optional ReadonlymatchInclude item descriptions when filtering (default: false).
Optional ReadonlymatchInclude item details when filtering (default: false).
Optional ReadonlyonCalled whenever the highlighted item changes. Runs inside the platform event callback: handle expected errors locally, because a thrown exception is not converted into a rejected pick promise.
Optional ReadonlyonCalled when one of buttons is pressed. The picker stays open —
call picker.hide() to dismiss it, which resolves the pick with
undefined. Compare button by identity against the one you built.
Handle expected errors locally; callback exceptions propagate from the
platform event rather than settling the pick promise.
Optional ReadonlyonCalled when an inline button on an item is pressed. The picker stays open, so a row-level action can update the list in place. Callback exceptions follow the same platform-event behavior as PickOptions.onTriggerButton.
const remove = toPickButton('trash', { tooltip: 'Delete' });
const chosen = await pickOne(ui, keys.map((key) =>
({ ...toPickItem(key, { label: key }), buttons: [remove] })), {
onTriggerItemButton: (_button, item, picker) => {
picker.items = picker.items.filter((candidate) => candidate !== item);
},
});
Optional ReadonlyplacePlaceholder text shown in the empty filter box.
Optional ReadonlypromptInstructional text shown below the filter box and above the items.
Optional ReadonlysignalCancels the pick: aborting hides the picker and resolves undefined.
Pass an operation's context.signal so an open picker never outlives
the operation that showed it.
Optional ReadonlytitleTitle shown at the top of the picker.
Options accepted by
pickOneandpickMany.