Skip to content

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.

PropTypeDefaultDescription
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.
productsProduct[][]The pickable catalogue. The app called `getAllProducts()` from `@/data/spaces` — a module the design system cannot import — so the list is a prop.
excludeIdsstring[][]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.
initialSearchstring""Seeds the search field so the filtered / empty states are static stories.
searchstring—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[]filterProductsByTitleFiltering strategy, injected so a story can pin an exact result set.
currencySymbolstring"$"Currency prefix for the default price formatter. AUD by default.
formatPriceProductPriceFormatter—Replace the price line wholesale.
fallbackCoverImagestring—Thumbnail used when a product has no `coverImage`.
titlestring"Add products to store"Undocumented — add TSDoc to the prop in the library.
addProductLabelstring"Add product"Undocumented — add TSDoc to the prop in the library.
searchPlaceholderstring"Search products..."Undocumented — add TSDoc to the prop in the library.
emptyLabelstring"No products found"Undocumented — add TSDoc to the prop in the library.
closeOnSelectbooleantrueClose the dialog after a selection. Off keeps a gallery story open.
classNamestring—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.