Search Panel
π§© Overviewβ
The ai12z Search Panel allows seamless integration of AI-powered search capabilities which will show the suggestions with concise information.
π How to useβ
- Implement the Component
You can use the<ai12z-search-panel>
tag to include the search panel component in your HTML. This tag supports customization through several attributes.
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 |
redirect-url | string | βοΈ | The URL to redirect the user to after a search is submitted. |
placeholder | string | β | Allow us to customize the placeholder text in the searchbar |
π» 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 class="search-panel">
<ai12z-search-panel
data-key="your_api_key_here"
data-mode=""
placeholder="AI search"
redirect-url="/searchpage"
></ai12z-search-panel>
</div>
<!-- Style customization example, place after the `ai12z-cta tag to overide the style -->
<style>
.search-panel {
width: 50%;
top: 1rem;
position: fixed;
right: 1rem;
}
ai12z-search-panel {
--ai12z-search-panel-bg: #f3f4f6;
--ai12z-search-panel-icon-color: #fff;
--ai12z-search-panel-focus-color: rgb(59 130 246);
--ai12z-search-panel-input-border-color: gray;
--ai12z-search-panel-button-bgcolor: #007bff;
}
</style>
</body>
</html>
π¨ Custom CSS Propertiesβ
Property | Description | Default |
---|---|---|
--ai12z-search-panel-bg | Defines the background color of the AI search panel container. This property allows customization of the panelβs visual appearance to match your appβs theme or design system. | #f3f4f6; |
--ai12z-search-panel-icon-color | Defines the color of icons within the AI search panel (e.g., search, close, voice icons). Use this to ensure icons match your app's theme or maintain visual consistency. | #fff |
--ai12z-search-panel-focus-color | Specifies the focus ring or border color applied to interactive elements (like input fields or buttons) when they are focused inside the AI search panel. This enhances accessibility and visual feedback during user interaction. | rgb(59 130 246); |
--ai12z-search-panel-input-border-color | Defines the border color of the search input field inside the AI search panel. Use this to customize the inputβs appearance and ensure it matches your design system. | gray |
--ai12z-search-panel-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 |