Category

CategoryFilter

Sidebar filter panel with category tree, price range, brand selection, and sorting.

CategoryFilter

A sidebar filter panel for product listings. Supports category tree navigation, price range slider, brand multi-select, availability filters, and sort options.

Preview
Category
Brand
Price Range

Usage

<script setup>
const filters = ref({
  categories: [],
  priceRange: [0, 1000],
  brands: [],
  inStock: false,
  sortBy: 'newest',
})
</script>

<CCategoryFilter
  v-model="filters"
  :categories="categoryTree"
  :brands="brands"
  :price-min="0"
  :price-max="5000"
  @update:modelValue="fetchProducts"
/>

Collapsible Sections

<CCategoryFilter v-model="filters" collapsible />

Props

PropTypeDefaultDescription
modelValueFilterStaterequiredCurrent filter values
categoriesCategory[][]Category tree
brandsBrand[][]Available brands
priceMinnumber0Minimum price bound
priceMaxnumber10000Maximum price bound
collapsiblebooleantrueCollapsible filter sections
showCountbooleantrueShow item counts
uiPartial<{...}>Per-instance theme overrides

Events

EventPayloadDescription
update:modelValueFilterStateAny filter changed
clearAll filters cleared

Slots

SlotScoped PropsDescription
category{ category, selected, toggle }Custom category item
brand{ brand, selected, toggle }Custom brand item
price-range{ min, max, update }Custom price range input
actions{ clear }Custom clear/apply actions