ProductSpecificationsSelector
Renders the stack of variant/filter selector fields for a product so a
product configuration can be refined interactively.
The component renders only the field stack — no card, heading, or CTA
chrome. Compose those around it (a Card, your own title) when a surface
calls for a titled panel.
Usage
import { ImageRenderProps, ProductSpecificationsSelector, ProductSpecificationsSelectorProps } from "@desk/ui/compositions/product-specifications-selector";Best practices
Drive it as a controlled component: it renders from
filtersand emitsonFilterChange(key, value)— it holds no internal filter state, so persist the value and feed it back.It renders nothing when there are no
variantOptionsdimensions and nosiblingswith images — supplysiblings/siblingsWithAttributesso single-colourway products still show a fallback thumbnail.Pass
renderImage(wrappingnext/image) in Next.js; the default is a plain<img>. The component ships bare — wrap it in aCardwith your own heading when a panel is wanted.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| filters | Record<string, string | null> | ||
| onFilterChange | (key: string, value: string | null) => void | ||
| onSiblingSelect | (siblingId: string) => void | Callback when a sibling is selected (fallback variant selection) | |
| renderImage | (props: ImageRenderProps) => ReactNode | Custom image renderer (e.g., for next/image). Defaults to standard img element. | |
| selectedProductId | string | Currently selected product ID (for highlighting in sibling selector) | |
| siblings | Sibling[] | Sibling products for fallback variant selection when variantOptions is empty | |
| siblingsWithAttributes | SiblingWithAttributes[] | Full sibling data with variant attributes for computing compatible options on hover | |
| variantOptions | Partial<Record<"length" | "pattern" | "width" | "size" | "color_name" | "finish" | "substrate" | "product_finish_type", import("./product-specifications-types").VariantOption[]>> |
Also exports
- interface
ImageRenderProps - interface
ProductSpecificationsSelectorProps
Composition
Builds on