Forms / Search field

Forms

Search field

The page search bar and the compact finder with its filter.

import { EcoSearchField } from "vue-ecosphere"

Page search

Type and press Enter; Escape or the clear button empties it.

Last search: ""

Finder

Sits inside a toolbar and carries its own filter button.

Filter applied: false

API

NameTypeDefaultDescription
v-modelstring""The query. The clear button shows only while it has a value (has-value).
variant"search" | "finder""search"Full-width page bar, or the compact toolbar finder.
placeholderstring—What can be searched.
labelstring—Accessible name; falls back to the placeholder.
clearLabelstring"Clear search"Name and tooltip of the clear button.
filterbooleantrueFinder only: show the filter button (filb).
filterActive / filterOpenbooleanfalseFinder only: a filter is applied (is-on) / its menu is open.
filterLabelstring"Filter"Accessible name of the filter button.
@search(value: string) => void—Enter in the field.
@clear / @filter() => void—Clear button (or Escape) / filter button.
#filterslot—Replace the filter button, e.g. with a menu trigger.
attributesid, role, aria-*, listeners—Go to the <input> (class and style stay on the wrapper), so it can be a combobox's input. A keydown handler you pass runs first; preventDefault() keeps Enter or Escape for you.