Background color of the chooser panel. When nil (the default), the panel uses
the system's translucent glass/material effect.
If you set this to a solid or near-opaque color, also set textColor, subTextColor,
and placeholderColor to ensure readable contrast — they are not adjusted automatically.
Border color drawn around the chooser panel. When nil (the default), no border is drawn.
Width of the border drawn around the chooser panel, in points (default: 1).
Has no effect unless borderColor is also set.
The right-click menu shown for every row (default: [], no menu).
Each entry is either { title: "..." } for a menu item, or { type: "divider" } for a
separator. Any other fields on an entry (e.g. an id) are passed back to
onContextMenuSelect unchanged, so one handler can tell the entries apart.
Rows whose choice has contextMenu: false show no menu, e.g. for a "Clear history" row.
Corner radius of the chooser panel, in points (default: 14).
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 when the user picks an entry from the contextMenu, or null to remove the handler.
choice is the row that was right-clicked (same shape as onSelect's argument) and
menuItem is the contextMenu entry that was picked, with any custom fields intact.
The chooser stays open.
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 when the selected row changes while the chooser is visible, or null to remove the handler.
Use this to show something that depends on the selected row, such as a preview, and keep it up to date as the user moves through the rows.
The arguments are the new selectedRow and the row object (same shape as onSelect), or
null for the item when no rows match the query. It is called once when the chooser is
shown, then whenever the selection moves to a different row, or the row it is on changes
to a different choice: arrow keys, Page Up/Down, Home/End, a click, a new query, new
choices, or setting selectedRow from JavaScript.
Called after the panel becomes visible, or null to remove the handler.
Placeholder text shown in the empty search field (default: "Search...").
Color of the placeholder text (and search icon) shown in an empty search field.
When nil (the default), the system's secondary label color is used.
The current text in the search field. Setting this from JS updates the display but
does not invoke the onQueryChange callback.
Color of the text the user types into the search field. When nil (the default),
the system's primary label color is used.
Font size of the search field's typed text and placeholder, in points (default: 20).
Changing this also rescales the search icon, and changes the search bar height
(and therefore the panel height) to fit. Must be a positive, finite number; invalid
values are ignored (with a warning logged).
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).
Background tint of the highlighted row. When nil (the default), a translucent
tint of the system accent color is used.
Color of each result row's subtext. When nil (the default), the system's
secondary label color is used.
Font size of each result row's subtext, in points (default: 12). Changing this
also changes the row height (and therefore the panel height) to fit. Must be a
positive, finite number; invalid values are ignored (with a warning logged).
Color of each result row's main text. When nil (the default), the system's
primary label color is used.
Font size of each result row's main text, in points (default: 14). Changing this
also rescales the ⌘-digit shortcut hint shown on the first ten rows, and changes the
row height (and therefore the panel height) to fit. Must be a positive, finite number;
invalid values are ignored (with a warning logged).
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.
Set the choices list. Pass a static array or a function:
refreshChoices() and
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. SetcontextMenu: falseon a choice to show no context menu on its row.Context menu
A single right-click menu, set with
contextMenu, is shared by every row (except choices withcontextMenu: false). When the user picks one of its entries,onContextMenuSelectis called with the row's choice and the menu entry.Keyboard shortcuts
onSelectwithnull)visibleRowsrows) at a time