Install the AI search bar
A search bar that understands sentences. Visitors type what they want in their own words ("a green sofa for 3 under €1,000"): the bar turns it into filters they can edit and shows the matching products as they type. They add to cart from the results, pick products to compare, or carry on with the assistant when the chat widget is on the page.
Place it in your site's header, instead of or next to your current search field.
Whitelist your domain first
The search bar only loads on domains whitelisted in the URL whitelist page of your dashboard. Add every environment you embed on (prod, staging, preview, etc.).
Preview
This preview runs on a demo garden shop with a French catalog: click the bar, then type jardin or gants. To try the bar on your own catalog, open the AI search bar page of your dashboard.
What visitors get
- At rest: a search field with rotating example requests. A click on it, typing on it, or ⌘K / Ctrl+K anywhere on the page opens the search.
- Before typing: their recent searches, example requests and recommended products.
- While typing: suggestions to complete the text, the filters read from it (pills they can edit or remove), the matching products, and the collections and pages of your store that match. A question that calls for advice is suggested to the assistant instead.
- Buying: product cards follow your chat widget's add-to-cart button and your product rules (price on request, subscription first, cart off...). A product with options opens a sheet to pick them.
- Comparing: with the chat widget on the page, visitors select up to 4 products and ask the assistant to compare them, find similar ones or tell them more. Ask on a card opens the chat on that product.
Design
On the AI search bar page of your dashboard, Customize the widget opens a side panel with a live preview on your catalog, on a phone or a desktop:
- Texts: the bar's first request and the button's label, in each of your store's languages.
- Display: the search bar (the field, with rotating example requests) or a button (a "Search" magnifier button, the magnifier alone on phones).
- Opening: in the bar (the default: the bar grows in place and the results unfold under it) or over the page (the search opens in a centered window, the page blurred behind it). On phones, the search opens full screen either way.
- The bar's look: background, border, text, icons and
+colors, corner radius, height, maximum width, shadow. - The button's look: background, text and border colors, corner radius, height, magnifier only.
Each change is saved at once and applies to the bar already on your site, with no code to change. Whatever you leave on "Default" follows your chat widget (brand colors, font, corners). To set a different design on one page, use the attributes: they override the dashboard for that tag.
Install
Paste the code where the bar should appear, usually in your site's header:
<script src="https://widgets.thehumind.com/v1/loader.js" defer></script>
<humind-search company-id="YOUR_COMPANY_ID"></humind-search>The dashboard's AI search bar page gives you this snippet with your company ID filled in. Load the script once per page, even with several Humind widgets.
Shopify
There is no theme app block for the search bar yet. Paste the code in your theme where the bar should sit: usually sections/header.liquid (Online Store > Themes > ... > Edit code), or a Custom Liquid section or block in the theme editor. On Shopify you can use the shop's domain instead of the company ID:
<script src="https://widgets.thehumind.com/v1/loader.js" defer></script>
<humind-search shop-domain="{{ shop.permanent_domain }}"></humind-search>Add to cart
Adding to cart uses the same setup as the chat widget (see Add to cart): nothing more to connect for the search bar. A product that cannot be added links to its page.
Size
The closed bar is up to 560 px wide and takes the width of its container below that (the button keeps its own size). Set --humind-search-max-width on the element to change the maximum:
humind-search {
--humind-search-max-width: 720px;
}On phones, the search opens full screen.
Attributes
| Attribute | Type | Purpose |
|---|---|---|
company-id | string | Your Humind company ID. Use this or shop-domain. |
shop-domain | string | Alternative to company-id: a domain registered on your company (on Shopify, the Liquid variable shop.permanent_domain). |
market-key | string | Multimarket setups only: names the market when several markets share one domain. See several markets on one domain. |
language | string | ISO 639-1 code for the bar's own wording. Supported: en, fr, de, es, it, nl. Default: the page's lang, then English. |
placeholder | string | First text shown in the bar, before the rotating example requests. Default: the dashboard's, else the bar's own wording. |
primary-color | string | Overrides your brand color. |
rounding | number | Corner radius of the bar, from 0 to 48 (px). Default: the dashboard's, else your chat widget's rounding. |
display | string | bar: the search field. button: a "Search" magnifier button, the magnifier alone on phones. Default: the dashboard's choice, else bar. |
layout | string | inline: the bar grows in place and the results unfold under it. overlay: the search opens in a panel centered over the page. Default: the dashboard's choice, else inline. |
bar-background-color, bar-border-color, bar-text-color, bar-icon-color, bar-plus-background-color | string | The bar's colors (any CSS color). |
bar-height | number | Height of the bar, from 40 to 72 (px). |
bar-max-width | number | Maximum width of the bar, from 240 to 1200 (px). |
bar-shadow | string | false removes the bar's shadow. |
button-background-color, button-text-color, button-border-color | string | The button's colors (any CSS color). |
button-radius | number | Corner radius of the button, from 0 to 48 (px). |
button-height | number | Height of the button, from 32 to 64 (px). |
button-icon-only | string | true: the magnifier alone, on desktops too. |
button-label | string | The button's text. |
suggestions | string | off hides the suggestions that complete the text. |