Developers
Start building
Themes/Theme SDK/Modules/product/Types: PersonalizationState to ReviewsBy

Types: PersonalizationState to ReviewsBy

The types of @poltura/theme-sdk/product, PersonalizationState to ReviewsBy.

On this page
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) => void

Sets 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`.

maxnumber

The 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.

classNamestring

Classes added to the list.

ProductDetailsProps

Props of ProductDetails.

classNamestring

Classes added to the panel.

ProductHeaderProps

Props of ProductHeader.

showReviewsSummaryboolean

Shows the star rating and review count; on by default.

vendorLabelstring

The text before the maker's name, such as "Brand".

skuLabelstring

The text before the stock keeping unit, such as "SKU".

classNamestring

Classes added to the header.

ProductHighlightsProps

Props of ProductHighlights.

classNamestring

Classes added to the list.

ProductKeySpecsProps

Props of ProductKeySpecs.

classNamestring

Classes added to the rows.

ProductSharePanelProps

Props of ProductSharePanel.

openrequiredboolean

Whether the dialog is open.

onOpenChangerequired(open: boolean) => void

Called when the dialog opens or closes.

titlerequiredstring

The product's title, used as the message subject.

urlrequiredstring

The address to share.

descriptionstring

The text shared with the link; a short invitation by default.

classNamestring

Classes 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.

classNamestring

Classes added to the table.

ProductTabContentProps

Props of ProductTabContent.

tabrequiredProductTab

The tab whose content to draw.

specsLayout'table' | 'list'

How the specifications tab draws its rows; a table when omitted.

classNamestring

Classes added to the content.

ProductTableLinkProps

Props of ProductTableLink.

tablerequiredProductTable

The table the link opens.

classNamestring

Classes added to the link.

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.

tablerequiredProductTable

The table to draw.

classNamestring

Classes added to the view.

ProductTabsProps

Props of ProductTabs.

displayProductTabsDisplay

A 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.

descriptionLabelstring

Ignored.

specsLabelstring

Ignored.

activationLabelstring

Ignored.

warrantyLabelstring

Ignored.

classNamestring

Classes added to the tabs.

SpecValueLabelProps

Props of SpecValueLabel.

valuerequiredSpecValue

The value to draw.

iconOnlyboolean

Shows only the icon, with the label as its accessible name; a value without an icon still shows its text.

classNamestring

Classes added to the label.

SpecValuesProps

Props of SpecValues.

specrequiredSpec

The attribute whose values to draw.

classNamestring

Classes added to the list of values.

RatingStarsProps

Props of RatingStars.

ratingrequirednumber

The rating, from 0 to 5; it is rounded to whole stars.

size'sm' | 'md'

Star size; defaults to `sm`.

RatingSummaryProps

Props of RatingSummary.

statsrequiredRatingStats

The review score to draw.

policyReviewPolicy

How the store checks its reviews; when given, the summary states it under the score.

ReviewCardProps

Props of ReviewCard.

reviewrequiredReview

The review to draw.

productLabelstring

The product's name, shown on a review in a list of several products.

isNewboolean

Fades the card in, for reviews that just loaded.

ReviewFormProps

Props of ReviewForm.

targetrequiredReviewTarget

What the review is about.

onClose() => void

Called when the shopper closes the form; without it no close button is drawn.

verifiedPurchaseboolean

Marks the review as a verified purchase in the form and its thank-you.

prefillEmailstring

The shopper's email address when known; the field is then left out.

prefillNamestring

The shopper's name when known.

tokenstring

The code from the review invitation email.

classNamestring

Classes added to the form.

ReviewInput

What a shopper fills in to review a product.

productIdrequiredstring

The product's id.

productHandlerequiredstring

The product's URL segment.

authorrequiredstring

The name shown with the review.

emailrequiredstring

The shopper's email address; it is never shown.

ratingrequirednumber

The star rating, from 1 to 5.

titlerequiredstring

The review's title.

bodyrequiredstring

The review's text.

tokenstring

The code from the review invitation email, which makes the review a verified purchase and skips the bot check.

ReviewResult

How sending a review ended.

okrequiredtrue

The review was received.

ReviewSkeletonProps

Props of ReviewSkeleton.

classNamestring

Classes 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[];
}
Last updated