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.

States: Default, Focus, Disabled, Invalid

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

PartRecipe
FilterFieldfilter-field
FilterFieldContentfilter-field-content
FilterFieldDescriptionfilter-field-description
FilterFieldLabelfilter-field-label
FilterFieldTitlefilter-field-title
FilterGroupfilter-group-content
FilterListfilter-list-root
FilterListfilter-list
FilterListfilter-list-search
FilterListfilter-list-item
FilterListfilter-list-check
FilterListfilter-meta
FilterTriggerfilter-trigger
FilterTriggerfilter-trigger-count
FilterRangefilter-range
FilterRangefilter-range-separator
FilterRatingfilter-rating
FilterRatingfilter-meta
FilterRatingfilter-rating-star
FilterResetfilter-reset-root
FilterResetfilter-reset
FilterSliderfilter-slider
FilterSliderfilter-meta
FilterSwatchfilter-swatch
FilterSwatchfilter-meta
FilterSwatchfilter-swatch-text
FilterSwitchfilter-switch

Install

Writes 18 files into components/ui/filter/. For agents, npx @frontic/ui docs filter prints this reference as markdown; the MCP server serves the same.

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

Built from

API reference

Filter Filter.vue

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

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

FilterField FilterField.vue

FilterFieldContent FilterFieldContent.vue

FilterFieldDescription FilterFieldDescription.vue

FilterFieldLabel FilterFieldLabel.vue

FilterFieldTitle FilterFieldTitle.vue

FilterGroup FilterGroup.vue

FilterList FilterList.vue

FilterTrigger FilterTrigger.vue

FilterPrice FilterPrice.vue

FilterRange FilterRange.vue

FilterRating FilterRating.vue

FilterReset FilterReset.vue

FilterSlider FilterSlider.vue

FilterSwatch FilterSwatch.vue

FilterSwitch FilterSwitch.vue

Example
State