Reviews Summary
Отзывы: средняя оценка, гистограмма-фильтр, сортировка и полезность. Pro · Магазин и платежи › Каталог
Установка
npx valyro-cli@latest login
npx valyro-cli@latest add reviews-summary
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ReviewsSummary } from 'valyro-ui-pro';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
reviews * | ReviewData[] | Reviews to list; sorting, the rating and verified filters and paging are applied to them here. | |
stats | ReviewStats | Totals from the server when reviews is only part of them; computed from reviews otherwise. | |
title | ReactNode | Heading; null hides it. Default "Customer reviews". | |
sort | 'recent' | 'helpful' | 'highest' | 'lowest' | Controlled sort; use with onSortChange. | |
defaultSort | 'recent' | 'helpful' | 'highest' | 'lowest' | 'recent' | Initial sort when uncontrolled. |
onSortChange | (sort: ReviewSort) => void | Called with the new sort when it changes. | |
rating | number | null | Whole-star rating the list is filtered to (set by the histogram), or null. | |
defaultRating | number | null | null | Initial rating when uncontrolled. |
onRatingChange | (rating: number | null) => void | Called with the new rating when it changes. | |
verifiedOnly | boolean | Controlled verifiedOnly; use with onVerifiedOnlyChange. | |
defaultVerifiedOnly | boolean | false | Initial verifiedOnly when uncontrolled. |
onVerifiedOnlyChange | (verifiedOnly: boolean) => void | Called with the new verifiedOnly when it changes. | |
votes | Record<string, ReviewVote> | The viewer's votes by review id. | |
defaultVotes | Record<string, ReviewVote> | {} | Initial votes when uncontrolled. |
onVotesChange | (votes: Record<string, ReviewVote>) => void | Called with the new votes when it changes. | |
pageSize | number | 5 | Reviews per page. Default 5. |
onWriteReview | () => void | Shows a "Write a review" button. | |
headingLevel | 2 | 3 | 4 | 2 | Heading level of the title; review titles use the next level. Default 2. |
locale | string | BCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's. | |
labels | Partial<ReviewsSummaryLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Product Card — Карточка товара
- Product Grid — Каталог товаров
- Product Filters — Фильтры каталога
- Product Spotlight — Рекомендованный товар: фото с пометкой, цена, рейтинг и действия
- Guided Product Finder — Мастер подбора товара: вопросы с ветвлением и объяснение, почему подошло
- Location Card — Точка продаж: расстояние, часы работы, способы получения и заказ
- Shopping Cart Drawer — Выдвижная корзина
- Checkout Summary — Сводка оформления заказа
- Checkout Form — Оформление заказа: доставка, тип адреса, оплата и проверка полей
- Order Tracking — Отслеживание заказа: этапы, перевозчик, трек-номер и история
- Invoice — Счёт для печати: позиции, налоги, скидки и итоги в валюте
- Credit Card — Банковская карта: градиент или две тональности, сеть по номеру, бесконтактная оплата
Назад: Product Spotlight · Далее: Guided Product Finder · Весь раздел «Магазин и платежи»