SearchProductVariantSelector
Connected search-backed variant selector that resolves a search product and drives the existing VariantSelector presentation.
Best for
Import
import { SearchProductVariantSelector } from "@enadhq/enad-react-sdk/client/search"When to use it
Use SearchProductVariantSelector when the page wants the SDK to resolve a search-backed product and derive the existing VariantSelector axes, selected variant, and option switching behavior for you.
It is the fast path for:
- PDPs backed by Search GraphQL product data
- quick-view or mini-PDP shells that already receive a search product record
- apps that want the existing selector UI without rebuilding search-product variant state locally
If the page already owns the variant axes and selected state, stay on VariantSelector instead.
Composition notes
SearchProductVariantSelector keeps the boundary sharp:
VariantSelectorstays presentational- the connected wrapper owns search-product lookup, axis derivation, and best-next-variant selection
source supports the same adoption paths as the connected card:
{ type: "product", product }{ type: "slug", slug }{ type: "sku", sku }
Use onSelectedVariantChange when the page needs to react to the selected search variant without taking over the whole selector model. If the page needs direct access to the selected variant state or wants to render a custom PDP shell, drop to useSearchProductVariantSelector().
Behavior and theming guidance
Because this wrapper renders the standard VariantSelector, the shopper-facing option language, unavailable-state messaging, and control density should match the same presentational rules as the base selector.
Use the connected wrapper when variant resolution is the variable. Use the presentational selector when the axes and selected state are already settled outside the SDK.
Examples
Live examples you can edit directly in the sandbox.
Inline search product
Use the connected selector when the product already exists in search-product shape and you want the SDK to derive axes and selected state.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| source | string | — | No description yet. |
| enabled | boolean | — | No description yet. |
| defaultVariantId | string | — | No description yet. |
| selectedVariantId | string | — | No description yet. |
| labels | string | — | No description yet. |
| className | string | — | No description yet. |
| contextOverrides | string | — | No description yet. |
| onSelectedVariantChange | string | — | No description yet. |