# dialog/search Open an incremental-search list dialog. Typing filters the list live — space-separated tokens are matched case-insensitively and all must be substrings of the item (AND semantics). The result value is the selected item text. ## Syntax
[dialog/search "Title" $items ?query]
[dialog/search :id %{ :title "Title" :items $items }]
[dialog/search %{ :id :title :items :default "initial query" }]
## Parameters - `"Title"` — dialog title (defaults to `"Search"`) - `$items` — vector of strings to search - `?query` — optional initial query string - optional leading keyword id, or spec-map keys `:id`, `:title`, `:items`, `:default` ## Examples
[dialog/search "Open buffer" @{"alpha" "beta" "gamma"}]
[dialog/search "Packages" $names "json"]           # pre-filled query
[dialog/search %{ :title "Open" :items $paths :default "src" }]
[dialog/search :pick-file "Open" $paths]           # explicit id → :data~id :pick-file
## Returns In TUI hosts the call returns immediately — `true` when an explicit id was given (leading keyword or `:id` in the spec map), else the numeric request-id; the result arrives later as a `:message` event with topic `"dialog-result"` and `:data %{ :id :value :cancelled }`, where `:value` is the selected item text. In the `deft` scripting binary it blocks on stdin and returns the selected text directly (`nil` when cancelled or empty). ## See Also `dialog/menu`, `dialog/prompt`, `dialog/file-open`, `dialog/confirm`