# usePickerStandalone

**Category:** Base Components/Collections/Picker/Hooks

## API

### Description

`usePickerStandalone` is a React hook that creates the state for a [`PickerStandalone`](./?path=/story/base-components-picker--pickerstandalone) component — a full-page picker for selecting an item and navigating to a destination URL. It extends [`useCollection`](./?path=/story/common-hooks--usecollection) with picker-specific options like `defaultDestinationUrl` and `initialSelect`.

```tsx
import { usePickerStandalone } from '@wix/patterns';
```

### Extends

[`useCollection`](./?path=/story/common-hooks--usecollection)

---

### Example

```tsx
import { usePickerStandalone, PickerStandalone } from '@wix/patterns';

const state = usePickerStandalone({
  queryName: 'site-picker',
  fetchData: (query) => fetchSites(query),
  itemKey: (site) => site.id,
  itemName: (site) => site.name,
  limit: 20,
  defaultDestinationUrl: (site) => `/site/${site.id}/dashboard`,
});

return (
   site.name },
    ]}
  />
);
```

### Returns

`PickerStandaloneState` — pass it to ``.

### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `noItemsAvailableDestinationUrl` | `string` | No | - | URL to navigate to when there are no items available in the collection. |
| `initialSelect` | `true \| ((item: T, index: number) => boolean)` | No | - | A predicate for an item to be selected in the picker. Pass `true` to select the first item. |
| `defaultDestinationUrl` | `string \| ((item: T) => string)` | Yes | - | A destination URL or callback to redirect to when the user selects an item. Will be used when no query param override was provided. |
| `urlSegmentPropertyMap` | `Record<string, (keyof T)[]>` | No | - | Map of query params to object properties to allow for URL filtering. For example - `urlSegmentPropertyMap: { msid: ['metaSiteId'] }` will add support for `?msid=123` query params to filter `metaSiteId`. |
| `events` | `PickerStandaloneEvents<T, F>` | No | - | Optional callbacks for various events of the picker & collection state lifecycle:<br> - `onSingleItemAutoNavigation` - when the picker is opened and auto-selects the only item in the collection<br> - `onContinueToDestinationUrl` - when the user selects an item and submits<br> - `onReady` - fires when the picker is ready to be interacted with<br> - `onInitialPageFetched` - when the first page of items is ready<br> - `onSearch` - when fetching new items as a result new search<br> - `onSearchResults` - when the result of a search is ready<br> - `onNewPageStart` - when starting to load the next page of items<br> - `onNewPageAdded` - when the result of the next page is ready |
| `logoType` | `"wix" \| "editorx"` | No | - | The type of logo to display in the picker. |

