MultiSearch
A multi-select whose filter query shows as a search line. Typing fuzzy-matches
and ranks the options with the matched characters highlighted; Space toggles.
It collects a list<string> of the checked values.
$p->multiSearch('basket', 'Basket')
->options([
'apple' => 'Apple',
'banana' => 'Banana',
'carrot' => 'Carrot',
'tomato' => 'Tomato',
])
->default(['apple']) // Values pre-checked when the field opens.
->pageSize(10); // Matches visible before the list pages around the cursor.
Options
| Name | Description | Required | Default |
|---|---|---|---|
options() | The choices, as a value => label map (or added one at a time with option()). | Yes | - |
default() | Values pre-checked when the field opens. | No | [] (none) |
pageSize() | Matches shown before the list pages around the cursor. | No | 10 |
For headings, separators and disabled options, see Option groups.
Keyboard
| Key | Action |
|---|---|
| printable keys | Type to fuzzy-filter and rank the options |
↑ / ↓ | Move over the matches |
Space | Toggle the highlighted match |
→ / ← | Select all / deselect all visible |
Backspace | Delete a filter character |
Enter | Accept the checked set |
Esc | Cancel |
Display modes
In all four display modes - Unicode or ASCII, colour on or off:
| ANSI | No ANSI | |
| Unicode | ||
| ASCII |