what-works-global

select search field

by what-works-global
payload-packages
Custom fields
v3
>=3.30.0 <4

Overview

Summary generated from the README

Adds a selectSearch field whose options come from a server-side search function instead of static lists. The plugin registers a shared endpoint that the client component queries as the user types, passing the current query and selected values. Requires Payload 3.30 or newer.

Features

  • Search select field with optional multi-value selection through hasMany
  • Custom async searchFunction receives query, selected values, request and field context
  • Optional passing of full form data or sibling data to the search function
  • Refetch options when watched field paths change
  • Configurable debounce for typing and watched field changes

Use cases

  • Pick records from an external service such as Stripe customers while editing a document
  • Filter selectable options based on other field values like region or customer type

From the author

Payload plugin and field component for server-backed search select fields.

Installation

npm i @whatworks/payload-select-search-field

16

Stars

1

Forks

2

Open Issues

3 days ago

Last Updated

60

Weekly Downloads

v3.1.1

npm Version

46.1 KB

Unpacked Size

0

Dependencies

Repository stars

16+1 since Sep 6

Show data
Repository stars by day (UTC)
DateStars
Dec 5, 202616
Dec 4, 202616
Dec 3, 202616
Dec 2, 202616
Dec 1, 202616
Nov 30, 202616
Nov 29, 202616
Nov 28, 202616
Nov 27, 202616
Nov 26, 202616
Nov 25, 202616
Nov 24, 202616
Nov 23, 202616
Nov 22, 202616
Nov 21, 202616
Nov 20, 202616
Nov 19, 202616
Nov 18, 202616
Nov 17, 202615
Nov 16, 202615
Nov 15, 202615
Nov 14, 202615
Nov 13, 202615
Nov 12, 202615
Nov 11, 202615
Nov 10, 202615
Nov 9, 202615
Nov 8, 202615
Nov 7, 202615
Nov 6, 202615
Nov 5, 202615
Nov 4, 202615
Nov 3, 202615
Nov 2, 202615
Nov 1, 202615
Oct 31, 202615
Oct 30, 202615
Oct 29, 202615
Oct 28, 202615
Oct 27, 202615
Oct 26, 202615
Oct 25, 202615
Oct 24, 202615
Oct 23, 202615
Oct 22, 202615
Oct 21, 202615
Oct 20, 202615
Oct 19, 202615
Oct 18, 202615
Oct 17, 202615
Oct 16, 202615
Oct 15, 202615
Oct 14, 202615
Oct 13, 202615
Oct 12, 202615
Oct 11, 202615
Oct 10, 202615
Oct 9, 202615
Oct 8, 202615
Oct 7, 202615
Oct 6, 202615
Oct 5, 202615
Oct 4, 202615
Oct 3, 202615
Oct 2, 202615
Oct 1, 202615
Sep 30, 202615
Sep 29, 202615
Sep 28, 202615
Sep 27, 202615
Sep 26, 202615
Sep 25, 202615
Sep 24, 202615
Sep 23, 202615
Sep 22, 202615
Sep 21, 202615
Sep 20, 202615
Sep 19, 202615
Sep 18, 202615
Sep 17, 202615
Sep 16, 202615
Sep 15, 202615
Sep 14, 202615
Sep 13, 202615
Sep 12, 202615
Sep 11, 202615
Sep 10, 202615
Sep 9, 202615
Sep 8, 202615
Sep 7, 202615
Sep 6, 202615

Shared by 12 plugins in what-works-global/payload-packages.

npm weekly downloads

89+67 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 202689
Dec 4, 202690
Dec 3, 2026112
Dec 2, 2026143
Dec 1, 2026184
Nov 30, 2026184
Nov 29, 2026165
Nov 28, 2026122
Nov 27, 2026112
Nov 26, 2026150
Nov 25, 2026159
Nov 24, 2026162
Nov 23, 2026162
Nov 22, 2026188
Nov 21, 2026191
Nov 20, 2026278
Nov 19, 2026246
Nov 18, 2026326
Nov 17, 2026284
Nov 16, 2026292
Nov 15, 2026289
Nov 14, 2026296
Nov 13, 2026239
Nov 12, 2026217
Nov 11, 2026133
Nov 10, 2026142
Nov 9, 2026138
Nov 8, 2026113
Nov 7, 2026101
Nov 6, 202669
Nov 5, 202672
Nov 4, 202652
Nov 3, 202642
Nov 2, 202638
Nov 1, 202641
Oct 31, 202635
Oct 30, 202643
Oct 29, 202634
Oct 28, 202614
Oct 27, 202617
Oct 26, 202618
Oct 25, 202620
Oct 24, 202619
Oct 23, 202611
Oct 22, 202613
Oct 21, 202619
Oct 20, 202616
Oct 19, 202615
Oct 18, 202612
Oct 17, 202613
Oct 16, 202613
Oct 15, 202614
Oct 14, 202615
Oct 13, 202618
Oct 12, 202618
Oct 11, 202618
Oct 10, 202619
Oct 9, 202627
Oct 8, 202625
Oct 7, 202618
Oct 6, 202613
Oct 5, 202613
Oct 4, 202611
Oct 3, 202615
Oct 2, 20267
Oct 1, 202619
Sep 30, 202622
Sep 29, 202622
Sep 28, 202622
Sep 27, 202625
Sep 26, 202623
Sep 25, 202623
Sep 24, 202611
Sep 23, 202616
Sep 22, 202620
Sep 21, 202631
Sep 20, 202631
Sep 19, 202638
Sep 18, 202640
Sep 17, 202640
Sep 16, 202634
Sep 15, 202630
Sep 14, 202619
Sep 13, 202616
Sep 12, 20266
Sep 11, 20265
Sep 10, 20268
Sep 9, 20269
Sep 8, 202610
Sep 7, 202611
Sep 6, 202622

Each point is npm's rolling 7-day download count.

Health Score

62/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1064440892-select-search-field.svg)](https://payloaddirectory.dev/plugins/1064440892-select-search-field)
HTML
<a href="https://payloaddirectory.dev/plugins/1064440892-select-search-field"><img src="https://payloaddirectory.dev/badge/1064440892-select-search-field.svg" alt="Payload Directory"></a>
Updated Dec 2, 2026Created Sep 26, 2025Published Jul 8, 2026

README

Payload Search Select Field

Payload Search Select Field

 

Server-backed search select field and plugin for Payload. The client component queries a shared endpoint and passes the current search query plus any currently selected values.

Demo

Installation

pnpm add @whatworks/payload-select-search-field

Usage

Add the plugin:

import { selectSearchPlugin } from '@whatworks/payload-select-search-field'

export default buildConfig({
  plugins: [selectSearchPlugin()],
})

Add a field with selectSearch (recommended):

import { selectSearch } from '@whatworks/payload-select-search-field'

selectSearch({
  name: 'stripeCustomer',
  hasMany: true,
  search: {
    debounce: {
      query: 250,
      watchedFields: 600,
    },
    passDataToSearchFunction: true,
    passSiblingDataToSearchFunction: true,
    watchFieldPaths: ['customerType', 'region'],
    searchFunction: async ({ query, selectedValues }) => {
      return [
        { value: 'cus_123', label: `Result for ${query}` },
        ...selectedValues.map((value) => ({
          value,
          label: `Selected: ${value}`,
        })),
      ]
    },
  },
})

debounce controls request timing:

  • query: debounce in ms for search input typing.
  • watchedFields: debounce in ms for watchFieldPaths-driven refetches.

searchFunction receives:

  • query: the current input text.
  • selectedValues: an array of currently selected values (empty array when nothing is selected).
  • siblingData: sibling field values for the current field path when passSiblingDataToSearchFunction: true.
  • data: full form data when passDataToSearchFunction: true.
  • req, field, and collection/global context.

The client component calls the shared endpoint path from selectSearchEndpoint.

Similar plugins