Visual Customization
Accent Color
The accent color is used throughout the widget’s design:- Header gradient (from accent color to dark blue)
- Input field focus border
- Toggle button gradient
You can use any valid CSS color format: hex (
#7c3aed), rgb (rgb(124, 58, 237)), hsl (hsl(258, 84%, 57%)), or color names (purple).Accent Color Examples
Brand Color Suggestions
Brand Color Suggestions
- Blue (Default):
#0ea5e9- Professional and trustworthy - Purple:
#7c3aed- Creative and modern - Green:
#10b981- Eco-friendly and growth-focused - Orange:
#f97316- Energetic and friendly - Pink:
#ec4899- Playful and welcoming - Teal:
#14b8a6- Calm and balanced
Position
Control which corner of the screen displays the widget:Widget Dimensions
The widget automatically adapts to different screen sizes:Desktop
- Width: 360px
- Height: 520px (max 100vh - 120px)
- Toggle button: 62px × 62px
- Corner spacing: 24px from edges
Mobile
- Width: 100% (with 12px margins)
- Height: min(72vh, 560px)
- Corner spacing: 12px from edges
Text Customization
Customize the text elements to match your brand voice:Header Title
Welcome Message
Input Placeholder
Behavior Customization
Session Persistence
The widget useslocalStorage to maintain user sessions across page loads:
os-chatbot-session-id):
- Generated once per browser/user
- Persists across page reloads
- Used to maintain conversation history
- Generated using
crypto.randomUUID()or fallback
os-chatbot-widget-open):
- Remembers if the widget was open or closed
- Restores state when user returns to the page
- Values:
"true"or"false"
Toggle Behavior
The toggle button shows different states:- Closed: Shows “AI” text
- Open: Shows ”×” (close icon)
Typing Indicator
While waiting for a response, the widget displays an animated typing indicator:Styling Tips
Match Your Brand
- Extract your brand color: Use your primary brand color for
data-accent-color - Consistent voice: Match your
data-welcome-messageto your brand tone - Position: Place the widget where it won’t interfere with existing CTAs
Accessibility Considerations
- The toggle button includes
aria-label="Toggle chat"for screen readers - High contrast text colors ensure readability
- Focus states are clearly visible with accent color borders
- The widget uses semantic HTML elements
Animation
The widget includes a subtle fade-in animation when opening:Complete Customization Example
Here’s a fully customized widget matching a brand identity:- Uses a purple accent color for a creative brand
- Positions on the right (most common for Western audiences)
- Uses friendly, conversational language
- Shows the company name in the header
Advanced Customization
For advanced customization beyond what data attributes provide, you would need to:- Fork the widget source code (
widget/src/index.ts) - Modify the
createStyles()function - Rebuild the bundle with
npm run build:widget - Deploy your custom bundle
Next Steps
Embedding
Learn how to embed the widget
Configuration
View all configuration options