Skip to content

Visual Theme Configuration ​

This document explains how to customize the visual appearance of your InsightEmbed widget to match your website's design and branding.

Theme Overview ​

The InsightEmbed widget is designed to be highly customizable, allowing you to create a seamless integration with your website's existing design. You can modify colors, typography, spacing, and other visual elements to create a consistent user experience.

Configuration Methods ​

You can customize the widget's appearance through:

  1. Management Portal: Use the visual theme editor in the Management Portal
  2. API: Set theme properties programmatically via the Widget Configuration API
  3. Initialization Options: Pass theme settings when initializing the widget

Color Scheme ​

Primary Colors ​

PropertyDescriptionDefault
primaryColorMain accent color used for buttons and interactive elements#3E63DD
primaryHoverColorColor for hover states of primary elements#364FC7
secondaryColorSecondary accent color#4B5563

Text Colors ​

PropertyDescriptionDefault
textColorMain text color#1F2937
textSecondaryColorSecondary text color for less emphasis#6B7280
linkColorColor for text links#3E63DD

Background Colors ​

PropertyDescriptionDefault
backgroundColorMain widget background color#FFFFFF
backgroundSecondaryColorSecondary background for panels and cards#F3F4F6
borderColorColor for borders and dividers#E5E7EB

Typography ​

Font Family ​

PropertyDescriptionDefault
fontFamilyPrimary font family'Inter', system-ui, sans-serif
headingFontFamilyFont family for headings (if different)inherit

Font Sizes ​

PropertyDescriptionDefault
baseFontSizeBase font size in pixels16
headingScaleScale factor for headings1.2

Border Radius ​

PropertyDescriptionDefault
borderRadiusBorder radius for widget corners in pixels8
buttonBorderRadiusBorder radius for buttons in pixels6

Shadows ​

PropertyDescriptionDefault
shadowColorColor for shadowsrgba(0, 0, 0, 0.1)
shadowIntensityShadow intensity (0-1)0.2

Example Configuration ​

Using the Management Portal ​

Navigate to Widget Settings > Visual Theme in the Management Portal to access the visual theme editor.

Using JavaScript Initialization ​

javascript
InsightEmbed.init({
  apiKey: 'YOUR_WIDGET_API_KEY',
  theme: {
    primaryColor: '#0F766E',
    backgroundColor: '#F8FAFC',
    textColor: '#334155',
    borderRadius: 12,
    fontFamily: '"Poppins", sans-serif',
    baseFontSize: 15
  }
});

Using the API ​

bash
curl -X PATCH https://api.insightembed.com/v1/widget/configuration \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "theme": {
      "primaryColor": "#0F766E",
      "backgroundColor": "#F8FAFC",
      "textColor": "#334155",
      "borderRadius": 12,
      "fontFamily": "\"Poppins\", sans-serif",
      "baseFontSize": 15
    }
  }'

Dark Mode Support ​

The widget can automatically adapt to your website's dark mode settings or be configured with a separate dark theme.

Auto Dark Mode Detection ​

By default, the widget detects if your website is using dark mode via the prefers-color-scheme media query or common CSS variables.

Custom Dark Theme ​

You can specify a separate dark theme configuration:

javascript
InsightEmbed.init({
  apiKey: 'YOUR_WIDGET_API_KEY',
  theme: {
    // Light theme settings
    primaryColor: '#0F766E',
    backgroundColor: '#F8FAFC',
    textColor: '#334155',
    
    // Dark theme settings
    dark: {
      primaryColor: '#14B8A6',
      backgroundColor: '#1E293B',
      textColor: '#E2E8F0',
      borderColor: '#475569'
    }
  }
});

Custom CSS ​

For advanced customization, you can provide custom CSS that will be injected into the widget's shadow DOM:

javascript
InsightEmbed.init({
  apiKey: 'YOUR_WIDGET_API_KEY',
  theme: {
    customCSS: `
      .insight-embed-button {
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
      
      .insight-embed-result {
        padding: 1.5rem;
      }
    `
  }
});

Best Practices ​

  1. Match Your Brand: Align the widget's colors and typography with your website's brand guidelines

  2. Contrast Ratio: Ensure sufficient contrast between text and background colors for accessibility

  3. Responsive Considerations: Test your theme on different screen sizes

  4. Dark Mode: Provide dark mode alternatives for better user experience

  5. Minimal Customization: Start with minimal changes to the default theme and adjust as needed

Theme Presets ​

The Management Portal offers several theme presets that you can use as starting points:

  • Default: Clean, professional appearance with blue accents
  • Minimal: Subtle, unobtrusive design with minimal styling
  • Bold: High-contrast design with strong colors
  • Elegant: Refined design with subtle shadows and animations

You can select a preset and then customize it further to match your specific requirements.