Product Filters
Фильтры каталога. Pro · Магазин и платежи › Каталог
Установка
npx valyro-cli@latest login
npx valyro-cli@latest add product-filters
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ProductFilters } from 'valyro-ui-pro';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
categories | ProductFilterOption[] | [] | Multi-select checkbox options with optional counts; the group is hidden when empty. |
priceBounds * | RangeValue | Price bounds in minor units (cents). | |
priceStep | number | 100 | Slider step in minor units (default 100 = one dollar). |
currency | string | 'USD' | ISO 4217 code for the price fields and chips. |
colors | ProductColorOption[] | [] | Multi-select color swatches; the group is hidden when empty. |
sizes | ProductFilterOption[] | [] | Multi-select option buttons — sizes, or any short values (brands, materials) with labels.size and labels.sizeChip renamed; the group is hidden when empty. |
ratings | number[] | [4, 3, 2] | "N★ & up" choices (default 4, 3, 2). Pass [] to hide the group. |
value | ProductFilterValue | Controlled value; use with onValueChange. | |
defaultValue | ProductFilterValue | Initial value when uncontrolled. | |
onValueChange | (value: ProductFilterValue) => void | Called with the new value when it changes. | |
layout | 'sidebar' | 'sheet' | 'sidebar' | sidebar (default): a panel with every group, for a column beside the catalog. sheet: for phone-width catalogs — a "Filters · N" button and the active-filter chips in one row; the groups open in a BottomSheet, collapsed except the ones in use. |
open | boolean | layout="sheet": whether the sheet with the groups is open. | |
defaultOpen | boolean | false | layout="sheet": initial open state when uncontrolled. |
onOpenChange | (open: boolean) => void | layout="sheet": called when the sheet opens or closes. | |
sheetContainer | HTMLElement | null | layout="sheet": render the sheet inside this element (position: relative; overflow: hidden) instead of over the viewport — for a catalog inside a device frame or a panel. Such a sheet does not trap focus or dim the page: the rest of the page stays usable. | |
resultCount | number | layout="sheet": products matching the current filters, counted on the sheet's button. | |
locale | string | Locale for prices and counts (default: the ThemeProvider's, then the browser's). | |
labels | Partial<ProductFiltersLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Product Card — Карточка товара
- Product Grid — Каталог товаров
- Product Spotlight — Рекомендованный товар: фото с пометкой, цена, рейтинг и действия
- Reviews Summary — Отзывы: средняя оценка, гистограмма-фильтр, сортировка и полезность
- Guided Product Finder — Мастер подбора товара: вопросы с ветвлением и объяснение, почему подошло
- Location Card — Точка продаж: расстояние, часы работы, способы получения и заказ
- Shopping Cart Drawer — Выдвижная корзина
- Checkout Summary — Сводка оформления заказа
- Checkout Form — Оформление заказа: доставка, тип адреса, оплата и проверка полей
- Order Tracking — Отслеживание заказа: этапы, перевозчик, трек-номер и история
- Invoice — Счёт для печати: позиции, налоги, скидки и итоги в валюте
- Credit Card — Банковская карта: градиент или две тональности, сеть по номеру, бесконтактная оплата
Назад: Product Grid · Далее: Product Spotlight · Весь раздел «Магазин и платежи»