ResponseDock Docs
Menu

SDK Theming

The shared host-theme contract is used by the browser SDK, embedded application, and survey renderer. Host values override survey and workspace defaults inside an embedded session.

Theme Object

interface EmbedTheme {
  logoUrl?: string;
  brandName?: string;
  primaryColor?: string;
  primaryTextColor?: string;
  secondaryColor?: string;
  backgroundColor?: string;
  surfaceColor?: string;
  textColor?: string;
  mutedColor?: string;
  borderColor?: string;
  errorColor?: string;
  fontFamily?: string;
  fontUrl?: string; // HTTPS WOFF2 asset
  borderRadius?: number | string;
  buttonStyle?: 'rounded' | 'square' | 'pill';
  optionStyle?: 'bordered' | 'minimal' | 'pill';
  cardShadow?: 'none' | 'subtle' | 'elevated';
  questionSize?: 'small' | 'medium' | 'large';
  surveyWidth?: 'narrow' | 'standard' | 'wide';
  hidePlatformBranding?: boolean;
}

SDK Usage

ResponseDock.init({
  projectKey: 'pk_live_xxx',
  theme: {
    primaryColor: '#1D4ED8',
    backgroundColor: '#F8FAFC',
    fontFamily: 'Host Sans',
    fontUrl: 'https://app.example.com/fonts/host.woff2'
  }
});
ResponseDock.embed('post-event', '#root');

// Optional live update
ResponseDock.updateTheme({ primaryColor: '#7C3AED' });

React SDK Usage

<SurveyProvider projectKey="pk_live_xxx" theme={hostTheme}>
  <SurveyEmbed surveyId="post-event" style={{ minHeight: 640 }} />
</SurveyProvider>

CSS Variable Reference

VariableMaps to
--q-primaryprimaryColor
--q-primary-textprimaryTextColor
--q-secondarysecondaryColor
--q-bgbackgroundColor
--q-surfacesurfaceColor
--q-texttextColor
--q-mutedmutedColor
--q-borderborderColor
--q-errorerrorColor
--q-radiusborderRadius
--q-fontfontFamily

Hosted Fonts

Supply an HTTPS WOFF2 URL with cross-origin access enabled. Without fontUrl, the requested family must already be installed on the respondent's device.

Precedence

  1. Current host-session theme, including validated runtime updates
  2. Survey-level theme
  3. Workspace branding defaults
  4. ResponseDock defaults