Search select

A select you can type into, for lists too long to scan by eye.

Refined portVue source: WildSearchSelect.vue

Try it

Open it and type “ohau” or a client’s name. The list holds 120 sites.

Site
Search by site or client.
Selection
Size
Error
Disabled
<WildSearchSelect
  v-model="siteId"
  label="Site"
  placeholder="Select site"
  search-placeholder="Search sites or clients"
  help="Search by site or client."
  :options="sites"
/>

When to use

  • Use it for lists too long to scan, such as sites or clients.
  • Use multiple when more than one choice is allowed.
  • Add meta to each option when names repeat across clients.
Don’t use it

Anatomy

A label and hint, the trigger, and a panel: a search row, rows with their meta, and a count line when the list is cut short.

Site120 sites
Bore 1Emu Park Orchards
Bore 2Blenheim Vineyards
Bore 3Kaituna Water Scheme
Bore 4Martinborough Estates
Bore 5Te Puke Kiwifruit
Bore 6Pukekohe Fresh
Showing the first 6 of 31 matches. Keep typing to narrow.

Multiple selection

Rows become checkboxes and the panel stays open. Choices show as chips, or as the first and a +N badge when space is tight.

Bore 12North PumpTank 3 — Woolshed
chips
+N badge

Sizes

The same heights as Select. The rows grow with the field.

sm · 36
lg · 44

States

Site
Choose a site to continue.
error
Site
disabled
Client
Site
Pick a client and the site list unlocks with its sites.

Content

  • Label it with a noun: Site, Client.
  • Write the placeholder as Select plus the noun: Select site.
  • Make disabledText say what unlocks the field: Choose a client first.
  • Keep meta short. A long one is cut off to fit.

Accessibility

The trigger announces its label and value. Opening focuses the search, and a screen reader follows the highlight and hears the count as you type.

KeyWhat it does
Enter / Space / ↓ / ↑On the trigger, opens the list.
A letterOn the trigger, opens it already searching.
↓ / ↑Moves the highlight. Wraps and skips unavailable rows.
Page Down / Page UpMoves the highlight eight rows.
EnterChooses the highlighted row. In multiple, ticks or unticks it and stays open.
Escape / Alt + ↑Closes the list, focus back on the trigger.
TabCloses the list and moves on.
Backspace / DeleteOn a chip’s cross, removes that choice.

Props

PropTypeDefaultDescription
v-modelstring | string[] | null—The choice, or choices with multiple.
options{ value, label, meta?, disabled? }[]—The choices. Meta is searched too.
labelstring—The field’s visible name.
ariaLabelstring—Accessible name without a visible label.
placeholderstring'Select option'Trigger text before anything is chosen.
requiredbooleanfalseAsterisk on the label; announced as required.
multiplebooleanfalseAllows more than one choice.
errorboolean | string—A string is shown as the message.
disabledbooleanfalseCan’t be opened or tabbed to.
disabledTextstring—Trigger text while disabled.
maxDisplayItemsnumber50Rows listed before the count line.
size'sm' | 'lg''sm'Height: 36 or 44px.
showChipsbooleantrueMultiple only: chips, or first choice and +N.
hintstring—Short context beside the label.
helpstring—Guidance under the field.
searchPlaceholderstring'Search'Placeholder in the search row.
noMatchTextstring'Nothing found'Shown when nothing matches.
namestring—Posts the value with a form.

Tokens

TokenValueWhere it lands
--radius-lg8pxTrigger and panel corners.
--global-neutral-grey-600#DCDCDETrigger border at rest.
--global-neutral-grey-800#ADACB0Trigger border on hover.
--global-blue-1000#1877F2Focused or open edge, the tick, Clear all.
--color-error#E12121Trigger edge on error.
--global-neutral-grey-500#E6E6E6Panel edge, disabled border.
--global-neutral-grey-300#F1F1F1Highlighted row.
--global-neutral-grey-200#F5F5F5Disabled ground.
--global-neutral-grey-400#ECECEDDividers inside the panel.
--global-neutral-grey-1000#4F4D55Placeholder, meta, count line.
--shadow-dropdown0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04)The open panel.