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. |
Certainly! Here's a clearer and more professional version of the searchText
URL parameter description:
π searchText
URL Parameterβ
You can pre-fill the search input and trigger the componentβs behavior by including the searchText
parameter in the URL. For example:
https://yourdomain.com/search?searchText=who%20is%20ai12z
-
If
load-results="true"
is set, the component will immediately treat thesearchText
as a question to the AI assistant, and display a direct answer. -
If
load-results="false"
is set, the component will behave as if the user is typing a search query. It will display a list of matching results with titles and links, but will not provide an answer until the user clicks the Ask AI button.
Let me know if you'd like to integrate this into your documentation.
π» 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 |