Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Search Bar

The lens-searchbar component offers an interface for exploring of all catalogue items. It serves as the primary interface for users to search, apply, and adjust query criteria. Selected items appear as interactive chips within the component, giving users a clear visual of their active filters. Users can easily refine their search by removing individual values or entire criteria directly from the chip display.


Behavior & Functionality

  • Search Input with Autocomplete:

    • Opens dropdown after 3+ characters.
    • Filters and displays grouped suggestions with optional counts and descriptions.
    • Keyboard navigation support (focusedItemIndex).
  • Search Chips:

    • Displays selected criteria as removable chips.
    • Nested value-level and item-level delete buttons.
    • Each chip displays:
      • Criterion name
      • Values
      • Optional explain button via QueryExplainButtonComponent
  • Autocomplete Items:

    • Rendered with bold-highlighted matches.
    • Supports facet counts from $facetCounts.
    • Fully keyboard- and mouse-navigable.
  • Clear Group Button:

    • Clears the entire group when clicked.
    • Emits a clear-search event.

Props

PropTypeDefaultDescription
noMatchesFoundMessagestring"No matches found"Message shown when no autocomplete options are found.
typeMoreMessagestring"Search will start with 3 inserted letters"Message shown when input is too short for autocomplete.
placeholderTextstring"Type to filter conditions"Placeholder in the search input field.
indexnumber0Used to manage multiple search bars (e.g., in groups or filters).

Example

<lens-search-bar
    placeholderText="Search filters..."
    noMatchesFoundMessage="No criteria match"
    typeMoreMessage="Type at least 3 characters to search"
    index="{1}"
/>

Styling

PartPurpose
lens-searchbarWrapper for the entire component
lens-searchbar-activeActive searchbar
lens-searchbar-chipsVisual query chip wrapper
lens-searchbar-chipQuery chip
lens-searchbar-chip-nameQuery chip criterion name
lens-searchbar-chip-itemQuery chip values wrapper
lens-searchbar-chip-item-textQuery chip singular value
lens-searchbar-inputMain input element
lens-searchbar-input-options-openMain input when autocomplete is open
lens-searchbar-autocomplete-optionsAutocomplete container
lens-searchbar-autocomplete-options-headingAutocomplete group heading
lens-searchbar-autocomplete-options-itemIndividual result
lens-searchbar-autocomplete-options-item-focusedHighlighted result
lens-searchbar-autocomplete-options-item-criterionSingle select result
lens-searchbar-autocomplete-options-item-numericNumeric result input wrapper
lens-searchbar-autocomplete-options-item-dateDate result input wrapper
lens-searchbar-autocomplete-options-item-stringString result input wrapper
lens-searchbar-autocomplete-options-item-nameOption name
lens-searchbar-autocomplete-options-item-descriptionOptional description
lens-searchbar-autocomplete-options-item-description-focusedFocused optional description
lens-searchbar-autocomplete-options-item-facet-countFacet count badge
lens-searchbar-autocomplete-options-type-more-messageWrapper for type more message