Types: PersonalizationState to ReviewsBy
The types of @poltura/theme-sdk/product, PersonalizationState to ReviewsBy.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/product';PersonalizationState
The personalisation texts of the product page's item and what the shopper has typed.
fieldsrequiredreadonly PersonalizationField[]The fields to fill in, in the merchant's order.
valuesrequiredReadonly<Record<string, string>>What the shopper typed, by field key.
setValuerequired(key: string, value: string) => voidSets the text of a field.
issuesrequiredReadonly<Record<string, PersonalizationIssue>>What is wrong with a field, by field key; shown once the shopper tries to add the item.
ProductBadgesProps
Props of ProductBadges.
badgesrequiredreadonly ProductBadge[]The badges to draw, in order; the product's `badges`.
maxnumberThe most badges to draw; 3 on a card and all of them on the product page by default.
placement'card' | 'page'`card` stacks small labels over a card's image corner; `page` lays them in a row above the title.
classNamestringClasses added to the list.
ProductDetailsProps
Props of ProductDetails.
classNamestringClasses added to the panel.
ProductHeaderProps
Props of ProductHeader.
showReviewsSummarybooleanShows the star rating and review count; on by default.
vendorLabelstringThe text before the maker's name, such as "Brand".
skuLabelstringThe text before the stock keeping unit, such as "SKU".
classNamestringClasses added to the header.
ProductHighlightsProps
Props of ProductHighlights.
classNamestringClasses added to the list.
ProductKeySpecsProps
Props of ProductKeySpecs.
classNamestringClasses added to the rows.
ProductSharePanelProps
Props of ProductSharePanel.
openrequiredbooleanWhether the dialog is open.
onOpenChangerequired(open: boolean) => voidCalled when the dialog opens or closes.
titlerequiredstringThe product's title, used as the message subject.
urlrequiredstringThe address to share.
descriptionstringThe text shared with the link; a short invitation by default.
classNamestringClasses added to the dialog.
ProductSpecsProps
Props of ProductSpecs.
groupsrequiredreadonly SpecGroup[]The specification groups to draw; the ungrouped rows come first.
layout'table' | 'list'A bordered table or a plain list of names and values; a table when omitted.
classNamestringClasses added to the table.
ProductTabContentProps
Props of ProductTabContent.
tabrequiredProductTabThe tab whose content to draw.
specsLayout'table' | 'list'How the specifications tab draws its rows; a table when omitted.
classNamestringClasses added to the content.
ProductTableLinkProps
Props of ProductTableLink.
tablerequiredProductTableThe table the link opens.
classNamestringClasses added to the link.
ProductTableLinks
Link tables by option: where they show in the variant picker.
byOptionrequiredReadonly<Record<string, readonly ProductTable[]>>The tables whose first column names the values of an option, by option id; draw each on that option's title row.
standalonerequiredreadonly ProductTable[]The tables that belong to no option; draw them in a row after the picker.
ProductTableViewProps
Props of ProductTableView.
tablerequiredProductTableThe table to draw.
classNamestringClasses added to the view.
ProductTabsProps
Props of ProductTabs.
displayProductTabsDisplayA tab bar, or an accordion with a heading per tab; a tab bar when omitted. A tab bar turns into the accordion on phones.
specsLayout'table' | 'list'How the specifications tab draws its rows; a table when omitted.
descriptionLabelstringIgnored.
specsLabelstringIgnored.
activationLabelstringIgnored.
warrantyLabelstringIgnored.
classNamestringClasses added to the tabs.
SpecValueLabelProps
Props of SpecValueLabel.
valuerequiredSpecValueThe value to draw.
iconOnlybooleanShows only the icon, with the label as its accessible name; a value without an icon still shows its text.
classNamestringClasses added to the label.
SpecValuesProps
Props of SpecValues.
specrequiredSpecThe attribute whose values to draw.
classNamestringClasses added to the list of values.
RatingStarsProps
Props of RatingStars.
ratingrequirednumberThe rating, from 0 to 5; it is rounded to whole stars.
size'sm' | 'md'Star size; defaults to `sm`.
RatingSummaryProps
Props of RatingSummary.
statsrequiredRatingStatsThe review score to draw.
policyReviewPolicyHow the store checks its reviews; when given, the summary states it under the score.
ReviewCardProps
Props of ReviewCard.
reviewrequiredReviewThe review to draw.
productLabelstringThe product's name, shown on a review in a list of several products.
isNewbooleanFades the card in, for reviews that just loaded.
ReviewFormProps
Props of ReviewForm.
targetrequiredReviewTargetWhat the review is about.
onClose() => voidCalled when the shopper closes the form; without it no close button is drawn.
verifiedPurchasebooleanMarks the review as a verified purchase in the form and its thank-you.
prefillEmailstringThe shopper's email address when known; the field is then left out.
prefillNamestringThe shopper's name when known.
tokenstringThe code from the review invitation email.
classNamestringClasses added to the form.
ReviewInput
What a shopper fills in to review a product.
productIdrequiredstringThe product's id.
productHandlerequiredstringThe product's URL segment.
authorrequiredstringThe name shown with the review.
emailrequiredstringThe shopper's email address; it is never shown.
ratingrequirednumberThe star rating, from 1 to 5.
titlerequiredstringThe review's title.
bodyrequiredstringThe review's text.
tokenstringThe code from the review invitation email, which makes the review a verified purchase and skips the bot check.
ReviewResult
How sending a review ended.
okrequiredtrueThe review was received.
ReviewSkeletonProps
Props of ReviewSkeleton.
classNamestringClasses added around the placeholder cards.
ReviewTarget
The product a review is written for; a bundle lets the shopper choose among its products.
type ReviewTarget = {
readonly product: {
readonly id: string;
readonly handle: string;
};
} | {
readonly products: readonly {
readonly id: string;
readonly handle: string;
readonly title: string;
}[];
}ReviewsBy
Which product or products a review list is about.
type ReviewsBy = {
readonly productId: string;
} | {
readonly productIds: readonly string[];
}