Store
Store product selector modal
Picks products to attach to something else, filtered by title.
Available
Ports as-is
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Store product selector modal
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
open* | boolean | — | Undocumented — add TSDoc to the prop in the library. |
onOpenChange* | (open: boolean) => void | — | Undocumented — add TSDoc to the prop in the library. |
onSelectProduct* | (product: Product) => void | — | Undocumented — add TSDoc to the prop in the library. |
products | Product[] | [] | The pickable catalogue. The app called `getAllProducts()` from `@/data/spaces` — a module the design system cannot import — so the list is a prop. |
excludeIds | string[] | [] | Products already placed; filtered out of the list. |
onAddProduct | () => void | — | "Add product" was chosen. The app called `navigate("/creator/products?addProduct=true")`; routing is the host's job. Leave undefined to hide the row entirely. |
initialSearch | string | "" | Seeds the search field so the filtered / empty states are static stories. |
search | string | — | Fully controlled search value. Wins over `initialSearch`. |
onSearchChange | (value: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
filter | (products: Product[], query: string) => Product[] | filterProductsByTitle | Filtering strategy, injected so a story can pin an exact result set. |
currencySymbol | string | "$" | Currency prefix for the default price formatter. AUD by default. |
formatPrice | ProductPriceFormatter | — | Replace the price line wholesale. |
fallbackCoverImage | string | — | Thumbnail used when a product has no `coverImage`. |
title | string | "Add products to store" | Undocumented — add TSDoc to the prop in the library. |
addProductLabel | string | "Add product" | Undocumented — add TSDoc to the prop in the library. |
searchPlaceholder | string | "Search products..." | Undocumented — add TSDoc to the prop in the library. |
emptyLabel | string | "No products found" | Undocumented — add TSDoc to the prop in the library. |
closeOnSelect | boolean | true | Close the dialog after a selection. Off keeps a gallery story open. |
className | string | — | Undocumented — add TSDoc to the prop in the library. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/store/StoreProductSelectorModal.tsx- Portability
- Copies across unchanged — only the utils import path moves.