Skip to content

ProductQuestions

Shoppers' questions about a product, each with its answers, marked by who gave them. Without questions it says so. Place it in the questions ProductDetailSection.

import { ProductQuestions } from "@evolve-storefront/feature-product/product-questions";

Renders inside ProductListingProvider.

Preview

DefaultOpen in Storybook ↗

Usage

<ProductDetailSection id="questions">
<ProductQuestions questions={questions} />
</ProductDetailSection>;

Props

PropTypeDescription
questionsreadonly ProductQuestion[]
renderQuestion?ProductQuestionRenderer

Replaces the default ProductQuestionItem.

Any other props go to the root element, like on a plain HTML element.

Change the layout

Pass children to ProductQuestions to arrange its parts yourself. Every part is exported from @evolve-storefront/feature-product/product-questions.

ProductQuestionItemOne question, who asked it and when, and its answers or that there are none yet.
PropTypeDescription
questionProductQuestion

Any other props go to the root element, like on a plain HTML element.

Examples

EmptyWithout questions the list says so, and the anchor leaves the section out.
<ProductQuestions questions={[]} />;
Open in Storybook ↗
Custom QuestionrenderQuestion replaces the default item; the list keeps its rows and keys.
<ProductQuestions
questions={questions}
renderQuestion={(question) => <MyQuestion question={question} />}
/>;
Open in Storybook ↗