Skip to content

BaseSearchItem

View source on GitHub

A search input component with search and clear icons, supporting color context and keyboard shortcuts. *

Props

NameTypeRequiredDescription
labelstringnoThe label for the search input.
inputColorstringnoThe color context for the input (e.g., "plant", "distillation", "results").

Emits

  • search
  • clear

Exposed Methods

changeSearchQuery()

Handles input changes and resets search state if needed.

emitSearchQuery()

Emits the search event and updates the store with the current input value.

clearSearchQuery()

Clears the search input and emits the clear event.

handleKeyPress()

Handles keyboard events for Enter (search) and Escape (clear).

Parameters:

  • event (KeyboardEvent): The keyboard event.