When true and the query is non-empty but there are no matching choices, onSelect
is called with { text: <query> } instead of null (default: false).
ReadonlyidentifierStable UUID string for this chooser instance.
Readonlyistrue if the chooser panel is currently on screen.
Called after the panel is hidden (for any reason: selection, Escape, or hide()), or null to remove the handler.
Called when the user activates a row whose valid field is false, or null to remove the handler.
The chooser stays open; the argument is the row dict (same shape as onSelect).
If unset, activating an invalid row is silently ignored.
Called on every keystroke with the new query string, or null to remove the handler. Use this to debounce expensive searches or trigger async data fetching.
Called when the user confirms a selection, or null to remove the handler.
The argument is the chosen row object (the original dict you passed to setChoices,
with text, subText, image, valid, and any custom fields intact).
The argument is null when dismissed (Escape).
Called after the panel becomes visible, or null to remove the handler.
Placeholder text shown in the empty search field (default: "Search...").
The current text in the search field. Setting this from JS updates the display but
does not invoke the onQueryChange callback.
Whether searches match against subText in addition to text (default: false).
Only applies when a static choices array is provided.
The zero-based index of the currently highlighted row (-1 when empty).
ReadonlytypeRead-only type identifier.
Maximum number of rows visible at once without scrolling (default: 10).
Width of the chooser as a fraction of the screen width (default: 0.5 = 50 %).
Hide the chooser without making a selection. Restores focus to the previously active window.
Self for chaining
Re-apply filtering (static choices) or re-invoke the choices function (dynamic).
Call after updating an external data source in an async onQueryChange handler.
Self for chaining
Programmatically confirm a selection.
Omit row to confirm the currently highlighted row. Fires onSelect (or onInvalid
for rows with valid: false) and hides the chooser.
Zero-based row index, or omit to use the current selection.
Self for chaining
Returns the dict for the highlighted row, or for a specific row by index.
Returns null if the index is out of range or no choices are set.
Zero-based row index, or omit to query the highlighted row.
The row dict ({ text, subText?, image?, valid, ...extras }) or null.
on show. The function is responsible for filtering; the chooser displays all items it returns.
An array of choice objects, or a function (query) => [...]
Self for chaining
A keyboard-driven floating chooser panel. Create via
hs.chooser.create(). Configure choices, set callbacks, then call.show().Choice format
Each choice is a plain object with required
textand optionalsubText,image,valid, andcontextMenufields. All other fields are passed through to theonSelectcallback unchanged. ThecontextMenuarray defines per-row right-click menu entries. Each entry is eitherKeyboard shortcuts