JS widget

JavaScript search widget: one line on your site

About 20 KB gzipped, no dependencies: finds the site's search field, opens a results window, works on mobile and picks up the store's color and font.

What your store gets

  • One line, no dependencies, about 20 KB gzipped
  • Finds the search field itself, modal and dropdown modes
  • Enter submits the site's own form unless a results URL is set
  • Ctrl+K, mobile layout, events to your analytics

Setup: one line of code

Installation

<script src="https://api.search.veera.space/widget/v1.js"
        data-key="pk_…" data-mode="modal"></script>

Attributes

Attribute What it does
data-mode modal (window) or dropdown (panel under the field)
data-input field selector, if auto-detection does not fit
data-button selector of a button that opens the window
data-search-url results page URL; without it Enter submits the site’s own form
data-cart-url add-to-cart URL
data-currency, data-group currency and price group
data-limit, data-min, data-delay number of results, minimum characters, delay
data-lang interface language; by default taken from the page
data-hotkey="off" turn off Ctrl+K

Styles are CSS variables such as --cps-accent; the JS API is CpSearch.open() and CpSearch.on('select', …).

Add the search window to your site

30 days free, no card. The widget line with your key is in the dashboard.

Start a 30-day free trial