Skip to content

Filter Item

A flexible and extensible Vue 3 component for rendering individual filter fields in different layouts (inline or vertical) and types (checkbox, radio, or text). It acts as a building block inside a filter panel or toolbar.

html
<filter-field
    name="search"
    type="text"
    layout="inline"
    label="Search"
    placeHolder="Enter keyword"
    v-model="searchQuery"
/>

Features

  • Supports three input types: text, checkbox, radio
  • Adapts layout: inline (popover-based) or vertical (sidebar-style)
  • Custom UI wrapper (PopoverLayout or VerticalLayout) depending on mode
  • Emits standard change, clear, and update:modelValue events
  • Accepts limit and placeholder for more control

Component API

PropTypeDefaultDescription
modelValuestring | string[] | number[]Bound model value
type'text' | 'checkbox' | 'radio' | 'range' | 'date'Input type
labelstringLabel for the filter
widthnumber220Filter width
namestringField name (used in events)
layout'inline' | 'vertical' | 'popover'inlineDisplay mode
placeholderstringPlaceholder text
disabledbooleanfalseDisables the input
defaultstring | string[] | number[]Default value for uncontrolled usage

Events

EventPayloadDescription
update:modelValuestring | string[]v-model binding
change{ name: string, value: string | string[] }Emitted when value changes
clearname: stringEmitted when clear button is triggered