Overview
The Rozz Search Box is a web component built with Lit. The component provides an AI-powered search interface. The component supports multiple display modes. The component supports real-time streaming responses. The component supports flexible integration options.
Key features include:
- Real-time AI streaming responses
- Four display modes: closed, open, static, and link
- Fully customizable styling
- Multi-language support (14 languages)
- Session persistence
- Programmatic control via a JavaScript API
Quick Start
Add AI-powered search to your website in two lines of code. No backend is required.
Basic Usage
Include the component script and insert the element.
Code example:
<!-- Include the component script -->
<script src="https://rozzum-bucket.rozz.site/rozz-searchbox.js"></script>
<!-- Add the component to your page -->
<rozz-searchbox
data-initial-status="closed"
data-theme-color="#d60a70">
</rozz-searchbox>
Component Attributes
Display Configuration
Display configuration options control how the component appears on the page.
| Property | Value | Type | |---|---|---| | data-initial-status | "closed" (default) | String | | | "open" | String | | | "chat" | String | | | "static" | String | | | "link" | String |
Example:
<rozz-searchbox data-initial-status="closed"></rozz-searchbox>
Styling Attributes
Styling attributes control the visual appearance of the component.
| Property | Value | Type | |---|---|---| | data-theme-color | Hex color or CSS color value | String | | data-font-family | CSS font-family value | String | | data-max-width | CSS size value | String | | data-max-height | CSS size value | String |
Examples:
<rozz-searchbox data-theme-color="#28a745"></rozz-searchbox>
<rozz-searchbox data-font-family="'Open Sans', sans-serif"></rozz-searchbox>
<rozz-searchbox data-max-width="1200px"></rozz-searchbox>
<rozz-searchbox data-max-height="75vh"></rozz-searchbox>
Color customization examples:
- data-query-text-color sets the text color for user queries.
- data-query-background sets the background color for user query blocks.
- data-result-text-color sets the text color for AI responses.
Default colors:
- data-query-text-color: white
- data-query-background: #d60a70
- data-result-text-color: #212529
Button Configuration
Button configuration options affect the floating button.
| Property | Value | Type | |---|---|---| | data-button-text | Text displayed on the floating button | String | | data-button-animation | true or false for the button pulse animation | Boolean | | data-button-background | Background for the floating button (CSS value) | String | | data-button-hover-color | Color for the button icon and text on hover | String |
Examples:
<rozz-searchbox data-button-text="NEED HELP?"></rozz-searchbox>
<rozz-searchbox data-button-animation="true"></rozz-searchbox>
<rozz-searchbox data-button-background="linear-gradient(135deg, #667eea 0%, #764ba2 100%)"></rozz-searchbox>
<rozz-searchbox data-button-hover-color="#0056b3"></rozz-searchbox>
Alternative via CSS:
rozz-searchbox {
--button-hover-color: #0056b3;
}
Button Positioning
Button positioning method sets the positioning behavior of the floating button.
| Property | Value | Type | |---|---|---| | data-button-positioning-method | "fixed" (default) | String | | | "standard" | String |
Position properties:
- data-button-top-position
- data-button-right-position
- data-button-bottom-position
Examples:
<rozz-searchbox
data-button-positioning-method="fixed"
data-button-bottom-position="20px"
data-button-right-position="20px">
</rozz-searchbox>
Programmatic API
Methods
openClickLink(domain, queryText)
- Opens the component and optionally auto-submits a query.
- This method is the primary control method for programmatic usage, especially for initial-status="link" mode.
Parameters:
- domain: String. The domain identifier to initialize the session. Required.
- queryText: String. The query text to auto-submit after opening. Optional.
Returns: Promise<void>.
Behavior:
- Opens the interface.
- Establishes a socket connection to the specified domain.
- If queryText is provided, the query is automatically submitted.
- Maintains session continuity across multiple calls.
Examples:
const searchbox = document.getElementById('rozz-searchbox');
searchbox.openClickLink('example-domain.com');
searchbox.openClickLink('example-domain.com', 'What are your office hours?');
Multiple links example (HTML + JavaScript):
<rozz-searchbox id="rozz-searchbox" data-initial-status="link"></rozz-searchbox>
<div id="county-links">
<button data-domain="county-a.gov" data-query="What are your office hours?">County A Hours</button>
<button data-domain="county-b.gov" data-query="How do I pay property taxes?">County B Taxes</button>
<button data-domain="county-c.gov" data-query="Where is the DMV located?">County C DMV</button>
</div>
<script>
const searchbox = document.getElementById('rozz-searchbox');
document.getElementById('county-links').addEventListener('click', function(event) {
const button = event.target.closest('button');
if (button) {
const domain = button.dataset.domain;
const query = button.dataset.query;
searchbox.openClickLink(domain, query);
}
});
</script>
Use cases:
- Multi-tenant systems: Different links for different domains or organizations.
- FAQ Quick Access: Pre-filled queries for common questions.
- Guided navigation: Context-specific queries from different page sections.
- Product demos: Multiple demo scenarios with different initial queries.
- Customer support: Quick access to specific help topics.
Session behavior:
- Session continues across multiple openClickLink() calls.
- Each new query is added to the conversation history.
- Clicking different links builds a multi-turn conversation.
- Session persists in localStorage until cleared.
Display Modes
Display modes control how the component appears and behaves.
Closed Mode:
- The component starts as a floating button.
- The user clicks to open the search interface.
Open Mode:
- The component opens automatically on page load.
- The input is ready for user interaction.
Chat Mode:
- The component displays as a compact chatbot popup panel (380×520px).
- The panel is anchored near the floating button.
- The page remains fully interactive; no backdrop overlay.
- The panel stays open until the user explicitly closes it.
- The X button, floating button, or the Escape key can close the panel.
- Conversations persist across open/close cycles.
- On mobile viewports (< 500px), the panel switches to fullscreen.
Static Mode:
- The component is always visible without a close button.
Link Mode:
- The component is hidden until programmatically opened via openClickLink().
- Perfect for multi-tenant scenarios or context-specific queries.
Code examples:
<rozz-searchbox data-initial-status="closed" data-button-text="ASK ANYTHING"></rozz-searchbox>
<rozz-searchbox data-initial-status="open"></rozz-searchbox>
<rozz-searchbox data-initial-status="chat" data-theme-color="#d60a70" data-button-animation="true"></rozz-searchbox>
<rozz-searchbox data-initial-status="static" data-max-width="100%"></rozz-searchbox>
<rozz-searchbox id="rozz-searchbox" data-initial-status="link"></rozz-searchbox>
<script>
const searchbox = document.getElementById('rozz-searchbox');
document.getElementById('help-link').addEventListener('click', () => {
searchbox.openClickLink('example-domain.com', 'How can I get support?');
});
</script>
Features
- Real-time Streaming: Responses stream in real time as the AI generates them.
- Session Management: Conversations are stored in localStorage.
- Multi-language Support: The component detects the browser language and displays appropriate placeholders and messages.
SUPPORTED LANGUAGES: English, Spanish, French, German, Italian, Portuguese, Dutch, Polish, Russian, Japanese, Chinese (Simplified), Korean, Arabic, Hindi.
- Follow-up Suggestions: After each response, the component may display suggested follow-up questions.
- Accessibility: ARIA labels for screen readers, keyboard navigation support, focus management, and live regions for dynamic content.
Advanced Examples
Custom Themed Component
<rozz-searchbox
data-initial-status="closed"
data-theme-color="#007bff"
data-font-family="'Inter', sans-serif"
data-button-text="HELP CENTER"
data-button-animation="true"
data-max-width="1200px"
data-query-background="#007bff"
data-result-text-color="#2c3e50">
</rozz-searchbox>
Embedded Search Page
<rozz-searchbox
data-initial-status="static"
data-max-width="100%"
data-max-height="100vh"
data-theme-color="#28a745">
</rozz-searchbox>
Multi-Domain Product Catalog
<rozz-searchbox id="product-search" data-initial-status="link"></rozz-searchbox>
<div class="product-grid">
<div class="product" data-domain="electronics.shop" data-query="Tell me about this laptop">
<img src="laptop.jpg" alt="Laptop">
<button class="ask-rozz">Ask about this product</button>
</div>
<div class="product" data-domain="electronics.shop" data-query="What are the specs of this phone?">
<img src="phone.jpg" alt="Phone">
<button class="ask-rozz">Ask about this product</button>
</div>
</div>
<script>
const searchbox = document.getElementById('product-search');
document.querySelectorAll('.ask-rozz').forEach(button => {
button.addEventListener('click', function() {
const product = this.closest('.product');
searchbox.openClickLink(product.dataset.domain, product.dataset.query);
});
});
</script>
Browser Support
The page lists test coverage for major browsers and versions, including Chrome/Edge, Firefox, Safari, and mobile browsers.
Performance Considerations
- Bundle Size: Production build is approximately 240–320 KB (minified and obfuscated).
- Gzipped size: Approximately 80–100 KB.
- Loading Strategy: Load the component script asynchronously with deferral recommended.
- Network Requirements: WebSocket connection to Rozz servers; fallback to polling if WebSocket is unavailable; automatic reconnection on connection loss.
Troubleshooting
- Component Not Rendering: Ensure the script loads before using the component. Check the browser console for JavaScript errors. Verify the custom element is defined: customElements.get('rozz-searchbox').
- Connection Issues: Check network connectivity. Verify server URL configuration. Check browser console for WebSocket errors.
- Styling Conflicts: The component uses Shadow DOM to prevent style conflicts. If customization beyond provided attributes is needed, modify the component source code.
Support
For issues or feature requests, contact rozz@rozz.site.
Author
Adrien Schmidt, Co-Founder & CEO, ROZZ.
Adrien has experience building AI systems and products for eBay and Cartier.
ROZZ is an AI infrastructure company.
Embedded Notes
ROZZ - AI Search Infrastructure.
rozz@rozz.site.
San Francisco Bay Area.
© 2026 ROZZ. All rights reserved.