Category Grid
Category page under the shop header: breadcrumb, title and description, result count and sort, a filter sidebar that becomes a sheet on small screens, a product gallery grid and pagination.
Parts
| Part | File | Does |
|---|---|---|
| CategoryGrid | CategoryGrid.vue | Shows a category page with header, filters, sorting and a grid of products. |
Styling
All of Category Grid’s styles live in category-grid.json. New to styling in Frontic UI? How styling works →
Install
- Installs with it
- accordion
- badge
- breadcrumb
- button
- empty
- filter
- filter-model
- header-shop
- navigation-shop
- pagination
- product-card-gallery
- scroll-area
- select
- separator
- sheet
- text
- npm packages
- @lucide/vue
- @vueuse/core
Built from
API reference
Shows a category page with header, filters, sorting and a grid of products. Renders a <div>.
Props 27
| Prop | Type | Default | |
|---|---|---|---|
| header | GridHeader | {} | |
| |||
| breadcrumbs | GridCrumb[] | [] | |
| |||
| title | string | '' | |
| |||
| description | string | '' | |
| |||
| products | Product[] | [] | |
| |||
| totalResults | number | 0 | |
| |||
| perPage | number | 12 | |
| |||
| filters | UiFilter[] | [] | |
| |||
| activeFilters | Record<string, unknown> | {} | |
| |||
| sortOptions | UiSort[] | [] | |
| |||
| activeSorting | string | 'default' | |
| |||
| swatchColors | Record<string, string> | { ...DEFAULT_SWATCH_COLORS } | |
| |||
| currency | string | 'EUR' | |
| |||
| locale | string | — | |
| |||
| resultsLabel | ((count: number) => string) | `${count} ${count === 1 ? 'product' : 'products'}` | |
| |||
| rangeLabel | ((from: number, to: number, total: number) => string) | `Showing ${from}–${to} of ${total} ${total === 1 ? 'product' : 'products'}` | |
| |||
| sortPlaceholder | string | 'Sort by' | |
| |||
| filtersLabel | string | 'Filters' | |
| |||
| showResultsLabel | ((count: number) => string) | `Show ${count} ${count === 1 ? 'product' : 'products'}` | |
| |||
| clearAllLabel | string | 'Clear all' | |
| |||
| removeLabel | ((label: string) => string) | `Remove ${label}` | |
| |||
| emptyTitle | string | 'No products match these filters' | |
| |||
| emptyText | string | 'Remove a filter or clear them all to see more.' | |
| |||
| previousLabel | string | 'Previous' | |
| |||
| nextLabel | string | 'Next' | |
| |||
| class | ClassValue | — | |
| |||
| page | number | 1 | |
| |||
Events 5
| Event | Payload | |
|---|---|---|
| reset | — | |
| ||
| update:page | value: number | |
| ||
| addFilter | field: string, value: UiFilterValue | |
| ||
| removeFilter | field: string, value?: string | undefined | |
| ||
| sortResult | sortBy?: string | undefined | |
| ||
Slots 1
| Slot | Slot props | |
|---|---|---|
| header | — | |
| ||
Recipe category-grid 1 group
Recipe category-grid-description 1 group
Recipe category-grid-dismiss 2 groups
Recipe category-grid-heading 1 group
Uses @heading, every property overridden.