Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the upgrade guide to upgrade your extension.

Picker API

Requires an admin UI block, action, or print extension.

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.

  • Resource selection: Enable resource picker dialogs for selecting products, customers, or other resources.
  • Multi-select: Build interfaces that allow selecting multiple resources at once.
  • Filtered selection: Provide filtered resource selection with search and filtering capabilities.
  • Workflow integration: Integrate resource pickers into configuration workflows.

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 options
options
required

Promise<>
Examples
import React, {useState} from 'react';
import {
reactExtension,
useApi,
Button,
Text,
} from '@shopify/ui-extensions-react/admin';

const TemplatePicker = () => {
const {picker} = useApi<'admin.product-details.block.render'>();
const [selected, setSelected] = useState<string[] | null>(null);

const handlePickTemplate = async () => {
const pickerInstance = await picker({
heading: 'Select a template',
multiple: false,
headers: [
{title: 'Templates'},
{title: 'Created by'},
{title: 'Times used', type: 'number'},
],
items: [
{
id: '1',
heading: 'Full width, 1 column',
data: ['Karine Ruby', '0'],
badges: [{content: 'Draft', tone: 'info'}, {content: 'Marketing'}],
},
{
id: '2',
heading: 'Large graphic, 3 column',
data: ['Russell Winfield', '5'],
badges: [
{content: 'Published', tone: 'success'},
{content: 'New feature'},
],
selected: true,
},
{
id: '3',
heading: 'Promo header, 2 column',
data: ['Russel Winfield', '10'],
badges: [{content: 'Published', tone: 'success'}],
},
],
});

const result = await pickerInstance.selected;
setSelected(result);
};

return (
<>
<Button title="Choose Template" onPress={handlePickTemplate} />
{selected && selected.length > 0 && <Text>Selected template: {selected[0]}</Text>}
</>
);
};

export default reactExtension(
'admin.product-details.block.render',
() => <TemplatePicker />,
);

Preview

Build a custom picker for email templates with multiple columns and status badges. This example shows defining column headers, populating items with searchable data fields, adding visual status indicators, and handling the selection promise. Use this pattern for app-specific resources like templates, product reviews, or subscription options where you need custom data structures beyond standard Shopify resources.

  • Handle undefined return on cancellation: When merchants cancel or close the picker, it returns undefined rather than an empty array. Check for undefined explicitly to distinguish cancellation from empty selection.
  • Disable items to prevent modification: Use the disabled property on items combined with selected: true to create preselected items that merchants can't deselect.

  • The Picker API only supports app-specific data. It can't display Shopify resources like products or variants. Use Resource Picker API for Shopify resources.
  • Picker items don't support hierarchical or nested structures. All items appear in a flat list.
  • The picker can't be customized with additional filters, search operators, or sorting beyond what merchants type in the search field.

Was this page helpful?