filter

Filter

The parts of a storefront filter: option lists with counts and search, swatches, a price range, ratings and switches, in groups that open in place or as a popover and reset together.

Parts

PartFileDoes
FilterFilter.vueGroups all parts of the filter and lets the user reset them together.
FilterFieldFilterField.vueGroups the title, control and description of one filter option.
FilterFieldContentFilterFieldContent.vueStacks a filter option's label and description beside its control.
FilterFieldDescriptionFilterFieldDescription.vueExplains a filter option below its label.
FilterFieldLabelFilterFieldLabel.vueLabels the control of a filter option.
FilterFieldTitleFilterFieldTitle.vueNames a group of filter options.
FilterGroupFilterGroup.vueShows a labelled set of filter options that opens and closes.
FilterListFilterList.vueLists filter options with result counts that the user can toggle and search.
FilterTriggerFilterTrigger.vueOpens and closes a filter group, showing its label and count of active options.
FilterPriceFilterPrice.vueLets the user limit products to a price range with a slider.
FilterRangeFilterRange.vueLets the user limit a value by typing a lowest and highest number.
FilterRatingFilterRating.vueLets the user limit products to those with a minimum star rating.
FilterResetFilterReset.vueLets the user clear all filters at once.
FilterSliderFilterSlider.vueLets the user limit a numeric value to a range with a slider.
FilterSwatchFilterSwatch.vueLists colour options as swatches that the user can toggle.
FilterSwitchFilterSwitch.vueLets the user turn a yes-or-no filter on or off.

Anatomy

<Filter>
  <FilterSwitch>
    <FilterField>
      <FilterFieldContent>
        <FilterFieldLabel />
        <FilterFieldDescription />
      </FilterFieldContent>
    </FilterField>
  </FilterSwitch>
  <FilterGroup>
    <FilterList />
    <FilterSwatch />
    <FilterPrice>
      <FilterSlider>
        <FilterField>
          <FilterFieldTitle />
          <FilterFieldDescription />
        </FilterField>
      </FilterSlider>
    </FilterPrice>
    <FilterRange>
      <FilterField>
        <FilterFieldTitle />
        <FilterFieldDescription />
      </FilterField>
    </FilterRange>
    <FilterRating>
      <FilterField>
        <FilterFieldTitle />
      </FilterField>
    </FilterRating>
  </FilterGroup>
  <FilterReset />
</Filter>

Styling

All of Filter’s styles live in filter.json. New to styling in Frontic UI? How styling works →

Install

npm packages
@lucide/vue
@vueuse/core
class-variance-authority
reka-ui

Built from

API reference

Filter.vue

Groups all parts of the filter and lets the user reset them together. Renders a <div>.

Props 4

PropTypeDefault
asChildbooleanfalse
asAsTag | Component'div'
classClassValue—
reset(() => void)—

FilterField.vue

FilterFieldContent.vue

FilterFieldDescription.vue

FilterFieldLabel.vue

FilterFieldTitle.vue

FilterGroup.vue

FilterList.vue

FilterTrigger.vue

FilterPrice.vue

FilterRange.vue

FilterRating.vue

FilterReset.vue

FilterSlider.vue

FilterSwatch.vue

FilterSwitch.vue
Filter
State