Skip to main content

Picker API

The Picker API lets merchants search for and select items from your app-specific data, such as product reviews, email templates, or subscription options. Use this API to build custom selection dialogs with your own data structure, badges, and thumbnails. The picker returns the IDs of selected items.

Tip

If you need to pick Shopify products, variants, or collections, use the Resource Picker API instead.

  • Custom resource selection: Help users find and select app-specific resources like email templates or subscription options.
  • Search interface: Provide a search-based interface for users to find resources from your app's data.
  • Multi-select: Allow users to select one or more items from a searchable list.
  • Custom data sources: Build pickers backed by your own data sources with custom search and filtering.

The picker function opens a custom selection dialog with your app-specific data. It accepts configuration options to define the picker's heading, items, headers, and selection behavior. It returns a Promise that resolves to a Picker object with a selected property for accessing the merchant's selection.

Anchor to heading
heading
string
required

The heading displayed at the top of the picker modal. Use a clear, descriptive title that tells merchants what they're selecting.

Anchor to items
items
[]
required

The list of items that merchants can select from. Each item appears as a row in the picker table.

Anchor to headers
headers
[]

The column headers for the picker table. Define headers to label and organize the data columns displayed for each item. The header order determines the column layout.

Anchor to multiple
multiple
boolean | number
Default: false

The selection mode for the picker. Pass true to allow unlimited selections, false for single-item selection only, or a number to set a maximum selection limit (for example, 3 allows up to three items).

The picker returns a Promise that resolves to an object containing the selected property. Use this handle to await the merchant's selection result.

Anchor to selected
selected
Promise<string[]>

A Promise that resolves with an array of selected item IDs when the merchant presses the Select button, or undefined if they cancel. Await this Promise to handle the selection result.


Was this page helpful?