Customization
Match the Triagly experience to your brand with theming, CSS variables, and custom triggers.
Widget Theming
const triagly = new Triagly({apiKey: 'pub_live_abc123',// Appearancetheme: 'dark',position: 'bottom-left', // or 'edge-left' for sidebar placementbuttonShape: 'pill', // 'rounded' | 'circular' | 'square' | 'pill' | 'expandable'buttonText: 'Share feedback',orientation: 'horizontal', // 'horizontal' | 'vertical'offsetX: '20px', // Custom horizontal offsetoffsetY: '20px', // Custom vertical offset// Localized copyplaceholderText: 'Tell us what you think...',successMessage: 'Thanks! Our team will take a look shortly.',});
Appearance Options
- theme — Force light or dark mode
- position — Any corner or edge placement
- buttonShape — rounded, pill, circular, square, expandable
- offsetX/offsetY — Fine-tune positioning
CSS Variables
Override CSS variables for pixel-perfect customization:
:root {/* Floating button */--triagly-button-bg: linear-gradient(135deg, #6366f1, #a855f7);--triagly-button-bg-hover: linear-gradient(135deg, #4f46e5, #9333ea);--triagly-button-text: #ffffff;--triagly-button-radius: 999px;/* Modal */--triagly-modal-bg: #0f172a;--triagly-modal-radius: 20px;--triagly-modal-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.45);--triagly-modal-backdrop: rgba(15, 23, 42, 0.65);/* Form controls */--triagly-input-bg: rgba(15, 23, 42, 0.7);--triagly-input-border: rgba(148, 163, 184, 0.4);--triagly-input-focus: #a855f7;/* Accent */--triagly-primary: #a855f7;--triagly-success: #34d399;--triagly-danger: #f87171;}
Custom Triggers
Hide the default button and trigger the widget from anywhere:
const triagly = new Triagly({apiKey: 'pub_live_abc123',buttonText: '', // Empty to hide default button});// Custom button triggerconst trigger = document.getElementById('feedback-btn');trigger?.addEventListener('click', () => triagly.open());// Keyboard shortcut (Cmd+K or Ctrl+K)document.addEventListener('keydown', (event) => {if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {event.preventDefault();triagly.open();}});
Ideas for Custom Entry Points
- Add a “Give Feedback” item to your user menu
- Connect to contextual help icons near complex features
- Provide a command-palette shortcut for power users
Pre-built Themes
Include a pre-built theme CSS file:
<!-- Dark theme --><link rel="stylesheet" href="https://unpkg.com/@triagly/sdk/themes/dark.css"><!-- Minimal theme --><link rel="stylesheet" href="https://unpkg.com/@triagly/sdk/themes/minimal.css"><!-- Gradient theme --><link rel="stylesheet" href="https://unpkg.com/@triagly/sdk/themes/gradient.css">