Overview
The Rozz Search Box is a web component built with Lit that provides an AI-powered interface. It supports multiple display modes, real-time streaming responses, and 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 JavaScript API
Quick Start
Add AI-powered search to your website in two lines of code. No backend required.
<!-- 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>
Table of Contents
- Overview
- Basic Usage
- Component Attributes
- Display Configuration
- Styling Attributes
- Button Configuration
- Button Positioning
- Programmatic API
- Display Modes
- Features
- Advanced Examples
- Troubleshooting
Basic Usage
To use the component, include the script and insert the element as shown above.
Component Attributes
Display Configuration
- data-initial-status: Controls the initial display state of the component.
- Values: "closed" (default), "open", "static", "link".
- Effect: Sets how the component is presented on page load.
Example: <rozz-searchbox data-initial-status="closed"></rozz-searchbox>
Styling Attributes
- data-theme-color: Sets the primary theme color for the component.
- Type: String (CSS color value)
- Default: "#d60a70"
- Example: <rozz-searchbox data-theme-color="#28a745"></rozz-searchbox>
- data-font-family: Sets the font family for the component.
- Type: String (CSS font-family)
- Default: "Rubik, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"
- data-max-width: Sets the maximum width of the modal.
- Type: String (CSS size value)
- Default: "900px"
- data-max-height: Sets the maximum height of the modal.
- Type: String (CSS size value)
- Default: "75vh"
Color Customization
- data-query-text-color: Text color for user queries
- data-query-background: Background color for user query blocks
- data-result-text-color: Text color for AI responses
Button Configuration
- data-button-text: Text on the floating button
- Default: "ASK ANYTHING"
- data-button-animation: Enables or disables the button pulse animation
- Type: Boolean
- Default: false
- data-button-background: Background for the floating button
- Default: uses theme color
- data-button-hover-color: Color of the button icon and text on hover
- Default: "black"
Alternative via CSS:
rozz-searchbox {
--button-hover-color: #0056b3;
}
Button Positioning
- data-button-positioning-method: Positioning method for the floating button
- Options:
- "fixed" (default) – Button stays in the viewport
- "standard" – Button positioned relative to document flow
Position properties:
- data-button-top-position
- data-button-right-position
- data-button-bottom-position
Example: <rozz-searchbox data-initial-status="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.
- Primary method for programmatic control, useful 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, submits the query automatically
- 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:
<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/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
Closed Mode
Component starts as a floating button. User clicks to open the search interface.
<rozz-searchbox data-initial-status="closed" data-button-text="ASK ANYTHING"></rozz-searchbox>
Open Mode
Component opens automatically on page load with input ready.
<rozz-searchbox data-initial-status="open"></rozz-searchbox>
Static Mode
Component is always visible without a close button. Ideal for dedicated search pages.
<rozz-searchbox data-initial-status="static" data-max-width="100%"></rozz-searchbox>
Link Mode
Component is hidden until programmatically opened via openClickLink(). Perfect for multi-tenant scenarios or context-specific queries.
<rozz-searchbox id="rozz-searchbox" data-initial-status="link"></rozz-searchbox>
<script>
// Trigger programmatically
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 stored in localStorage; sessions persist across reloads; expiration configurable (default 24 hours).
- Multi-language Support: Detects browser language and shows appropriate placeholders and messages.
- Supported languages: English, Spanish, French, German, Italian, Portuguese, Dutch, Polish, Russian, Japanese, Chinese (Simplified), Korean, Arabic, Hindi
- Follow-up Suggestions: Suggests follow-up questions after each response.
- Accessibility: ARIA labels, keyboard navigation, focus management, live regions for dynamic updates.
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 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
- Chrome / Edge: Latest 2 versions
- Firefox: Latest 2 versions
- Safari: Latest 2 versions
- Mobile browsers: iOS Safari, Chrome Mobile
Performance Considerations
- Bundle size: Production build ~240-320KB (minified + obfuscated); Gzipped ~80-100KB
- Loading strategy: Load the component script asynchronously
<script src="/static/rozz-searchbox.js" defer></script>
- Network requirements: WebSocket to Rozz servers; fallback to polling if WebSocket unavailable; automatic reconnect
Troubleshooting
Component Not Rendering
- Ensure the script is loaded before using the component
- Check browser console for JavaScript errors
- Verify 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
- To customize beyond provided attributes, modify the component source code
Support
For issues, questions, or feature requests, contact rozz@rozz.site
Author
Adrien Schmidt, Co-Founder & CEO, ROZZ
- Former AI Product Manager with 10+ years of experience building AI systems
- Founding Squid Solutions (Big Data analytics)
ROZZ
- AI Infrastructure
rozz@rozz.site
San Francisco Bay Area
© 2026 ROZZ. All rights reserved.