Vue search input with dropdown for more filters.


npm install --save @tillhub/vue-search-filter


Please see example folder for complete code example. Note, that the css has to be imported separately. This library assumes that element-ui is being used by the caller.

To see the example in action:

npm run serve
    resetButtonText="Reset now"
    input-placeholder="Search in customer names"
    <template slot="dropdown-content" slot-scope="{input, addTag}">
      <branch-filter :input="input" :add-tag="addTag"/>
      <status-filter :input="input" :add-tag="addTag"/>
      <active-switch :input="input" :add-tag="addTag"/>
      <date-picker :input="input" :add-tag="addTag"/>

import ThSearchFilter from '../src/index.vue'
import BranchFilter from './BranchFilter.vue'
import StatusFilter from './StatusFilter.vue'
import ActiveSwitch from './ActiveSwitch.vue'
import DatePicker from './DatePicker.vue'

export default {
  components: {
  methods: {
    handleSubmit (result) {
      console.log('submit', result)
    handleReset () {



Attribute Type Required Example Default Description
width number no 500 460 sets fixed width of component in pixels, minimum is 350
locale string no "de" "en" Currently only German and English is supported. Only 'de' and 'en '
inputPlaceholder string no "Search in products" "Search" Sets the placeholder text in the input field
searchButtonText string no "Submit" "Search" Sets a custom text in the blue submitting button
resetButtonText string no "Reset" "Cancel" Sets a custom text in the reset button


Event Description Params
submit triggers when the user clicks on "search" button filters
reset triggers when the user clicks on the "reset" button --
close-dropwdown triggers when the user closes the dropwdown --


One named slot it provided: "dropwdown-content". It is highly advised to refer to the example folder to see how this slot is used. Understanding the parent-child communication is crucial as the dropdown content and input content are closely linked.

Name Type Example Description
input object { key1: { label: "product name", value: "product uuid"}, key2: { label: "branch name", value: "branch uuid"} } this is an object that depicts the current state of the tags in the input field,
on every change they are passed to the slot so the consumer can update the slot children accordingly.
The key name is determined by the user, when it is being passed in the "addTag" method (see below).
addTag function ({ name, value, label }) => {} This method communicates the changes in the slot children to the parent.
It adds tags to the parent input field.E.g. it can be called on every change in the child.
The method expects to be called with an object with at least the "name" prop.
If "label" is falsey, it will default to "value".