Rozz Search Box Component API Reference

Overview

Quick Start

Add AI-powered search to your website in 2 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>

Basic Usage

<rozz-searchbox data-initial-status="closed"></rozz-searchbox>

Component Attributes

Display Configuration

| Property | Value | Type | Description |

|---|---|---|---|

| data-initial-status | "closed" (default), "open", "static", "link" | String | Controls the initial display state of the component. |

| Example | <rozz-searchbox data-initial-status="closed"></rozz-searchbox> | — | — |

Styling Attributes

| Property | Value | Type | Default |

|---|---|---|---|

| data-theme-color | CSS color value | String | "#d60a70" |

| data-font-family | CSS font-family value | String | "Rubik, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif" |

| data-max-width | CSS size value | String | "900px" |

| data-max-height | CSS size value | String | "75vh" |

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

| Attribute | Purpose | Default |

|---|---|---|

| data-query-text-color | Text color for user queries | "white" |

| data-query-background | Background color for user query blocks | "#d60a70" |

| data-result-text-color | Text color for AI responses | "#212529" |

Button Configuration

| Attribute | Description | Type | Default |

|---|---|---|---|

| data-button-text | Text displayed on the floating button | String | "ASK ANYTHING" |

| data-button-animation | Enables or disables the button pulse animation | Boolean | false |

| data-button-background | Background for the floating button | String | "" (uses theme color) |

| data-button-hover-color | Color of the button icon and text on hover | String | "black" |

Examples

<rozz-searchbox data-button-text="NEED HELP?"></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

| Attribute | Description | Type | Default |

|---|---|---|---|

| data-button-positioning-method | Sets the positioning method for the floating button | String | "fixed" |

Positioning properties (all CSS values):

Examples

<rozz-searchbox
  data-button-positioning-method="fixed"
  data-button-bottom-position="20px"
  data-button-right-position="20px">
</rozz-searchbox>

<rozz-searchbox
  data-initial-status="link"></rozz-searchbox>

<rozz-searchbox
  data-initial-status="open">
</rozz-searchbox>

<rozz-searchbox
  data-initial-status="static"
  data-max-width="100%">
</rozz-searchbox>

Programmatic API

Methods

Parameters

Returns

Behavior

Basic Usage

const searchbox = document.getElementById('rozz-searchbox');
searchbox.openClickLink('example-domain.com');

With Auto-Submit Query

const searchbox = document.getElementById('rozz-searchbox');
searchbox.openClickLink('example-domain.com', 'What are your office hours?');

Multiple Links with Different Queries

<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

Session Behavior

Display Modes

Code examples for each mode are shown in sections within the Display Modes area.

Features

Advanced Examples

Custom Themed Component

<rozz-searchbox
  data-initial-status="closed"
  data-theme-color="#0f7bff"
  data-font-family="'Inter', sans-serif"
  data-button-text="HELP CENTER"
  data-button-animation="true"
  data-max-width="1200px"
  data-query-background="#0f7bff"
  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

| Browser | Version |

|---|---|

| Chrome / Edge | Latest 2 versions |

| Firefox | Latest 2 versions |

| Safari | Latest 2 versions |

| Mobile browsers | iOS Safari, Chrome Mobile |

Performance Considerations

Troubleshooting

Component Not Rendering

Connection Issues

Styling Conflicts

Author and Support

Note: This section includes contact details and author bios that are part of the original page footer and are excluded from the main content flow in this documentation.

Embedded Examples and References