Widget Trigger Buttons
Enhance your website UX by adding custom buttons that can open, close, or toggle your chat widget. This allows you to integrate the widget seamlessly with your existing design and user flow.Basic Usage
1
Enable Trigger Buttons
When configuring your widget, ensure trigger buttons are enabled:
2
Add Data Attributes
Add the
data-knowflow-trigger attribute to any HTML element:3
Style Your Buttons
The trigger works on any HTML element, allowing for creative implementations:
4
Test Your Triggers
Load your website and test that the trigger buttons work as expected.
Supported Actions
| Action | Description | Use Case |
|---|---|---|
open | Opens the widget dialog | ”Get Help” buttons, FAQ links |
close | Closes the widget dialog | Custom close buttons in your UI |
toggle | Toggles the widget state | General “Chat” or “Support” buttons |
Advanced Implementation
Programmatic Control
Control the widget via JavaScript for advanced interactions:Dynamic Elements
The widget automatically detects trigger buttons added after page load:Event Handling
Listen for widget state changes:Real-World Examples
FAQ Page Integration
Support Card Design
Header Navigation
Best Practices
Design Guidelines
- Clear Call-to-Action: Use action-oriented text like “Get Help” or “Chat Now”
- Visual Hierarchy: Make trigger buttons visually distinct but not overwhelming
- Consistent Styling: Match your site’s design system and brand colors
- Accessibility: Include proper ARIA labels and keyboard navigation support
Placement Strategy
- FAQ Pages: Add “Still need help?” links after each question
- Product Pages: Include support triggers near pricing or technical details
- Error Pages: Offer immediate assistance when users encounter problems
- Checkout Flow: Provide help during critical conversion moments
Performance Considerations
- Minimal Impact: Trigger buttons add no performance overhead
- Progressive Enhancement: Buttons work even if the widget fails to load
- SEO Friendly: Search engines can still crawl and index your content
Troubleshooting
Trigger Buttons Not Working
Trigger Buttons Not Working
Programmatic API Not Available
Programmatic API Not Available
- Confirm that
window.KnowFlowWidgetexists for programmatic control - Wait for the widget to fully initialize before calling API methods
- Check that your widget configuration is valid
Dynamic Buttons Not Working
Dynamic Buttons Not Working