Search Results Page
π§© Overviewβ
The ai12z search result component provides both search suggestions and the ability to interact with an AI assistant in a conversational format.
π How to useβ
- Implement the Component
You can use the<search-results-page>
tag to include the search result component in your HTML.
Property | Type | Required | Description |
---|---|---|---|
data-key | string | βοΈ | API key from your ai12z project settings |
data-mode | string | βοΈ | Server to use dev or prod or local |
placeholder | string | β | Allow us to customize the placeholder text in the searchbar |
load-results | boolean | β | When load-results="true" β the component will fetch and display search suggestions.When load-results="false" β the component will start a conversation with the AI, treating the input as a message to the assistant rather than a keyword search. |
π» Example Codeβ
<html>
<head>
<script
type="module"
src="https://cdn.ai12z.net/pkg/ai12z@latest/dist/esm/library.js"
></script>
<link
rel="stylesheet"
href="https://cdn.ai12z.net/pkg/ai12z@latest/dist/library/library.css"
/>
</head>
<body>
<div>
<search-results-page
data-key="your_api_key_here"
data-mode=""
placeholder="AI search"
load-results="false"
></search-results-page>
</div>
<!-- Style customization example, place after the `ai12z-cta tag to overide the style -->
<style>
ai12z-search-panel {
--ai12z-search-page-bgcolor: #f3f4f6;
--ai12z-search-page-button-bgcolor: #007bff;
}
</style>
</body>
</html>
π¨ Custom CSS Propertiesβ
Property | Description | Default |
---|---|---|
--ai12z-search-page-bgcolor | Defines the background color of the AI search result container. This property allows customization of the panelβs visual appearance to match your appβs theme or design system. | #f3f4f6; |
--ai12z-search-page-button-bgcolor | Specifies the background color of buttons inside the AI search panel (e.g., submit or voice input buttons). Customize this to match your brand or theme. | #007bff |