Category Filter
A category's products with filters in collapsible sidebar sections, sorting, badges for the active filters, and a load-more button.
Parts
| Part | File | Does |
|---|---|---|
| CategoryFilter | CategoryFilter.vue | Shows a category's products with filters, sorting and a load-more button. |
Styling
All of Category Filter’s styles live in category-filter.json. New to styling in Frontic UI? How styling works →
Install
- Installs with it
- badge
- button
- collapsible
- empty
- filter
- filter-model
- product-card-basic
- scroll-area
- select
- separator
- sheet
- tag-group
- use-filter-state
- npm packages
- @lucide/vue
Built from
API reference
Shows a category's products with filters, sorting and a load-more button. Renders a <div>.
Props 24
| Prop | Type | Default | |
|---|---|---|---|
| filters | UiFilter[] | [] | |
| |||
| activeFilters | Record<string, unknown> | {} | |
| |||
| sortOptions | UiSort[] | [] | |
| |||
| activeSorting | string | 'default' | |
| |||
| totalResults | number | 0 | |
| |||
| title | string | '' | |
| |||
| description | string | '' | |
| |||
| products | Product[] | [] | |
| |||
| currency | string | 'EUR' | |
| |||
| locale | string | — | |
| |||
| resultsLabel | ((count: number) => string) | `${count} ${count === 1 ? 'result' : 'results'}` | |
| |||
| filtersLabel | string | 'Filters' | |
| |||
| sheetTitle | string | 'Filters' | |
| |||
| sortPlaceholder | string | 'Sort by' | |
| |||
| resetLabel | string | 'Reset' | |
| |||
| showResultsLabel | ((count: number) => string) | `Show Results (${count})` | |
| |||
| removeLabel | ((label: string) => string) | `Remove ${label}` | |
| |||
| activeFiltersLabel | string | 'Active filters' | |
| |||
| clearAllLabel | string | 'Clear all' | |
| |||
| emptyTitle | string | 'No products match these filters' | |
| |||
| emptyText | string | 'Remove a filter or clear them all to see more.' | |
| |||
| loadMoreLabel | string | 'Load more' | |
| |||
| swatchColors | Record<string, string> | { ...DEFAULT_SWATCH_COLORS } | |
| |||
| class | ClassValue | — | |
| |||
Events 5
| Event | Payload | |
|---|---|---|
| reset | — | |
| ||
| addFilter | field: string, value: UiFilterValue | |
| ||
| removeFilter | field: string, value?: string | undefined | |
| ||
| sortResult | sortBy?: string | undefined | |
| ||
| loadMore | — | |
| ||
Recipe category-filter 1 group
Recipe category-filter-description 1 group
Recipe category-filter-heading 1 group
Uses @heading, every property overridden.