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
| Variable | Maps to |
|---|---|
--q-primary | primaryColor |
--q-primary-text | primaryTextColor |
--q-secondary | secondaryColor |
--q-bg | backgroundColor |
--q-surface | surfaceColor |
--q-text | textColor |
--q-muted | mutedColor |
--q-border | borderColor |
--q-error | errorColor |
--q-radius | borderRadius |
--q-font | fontFamily |
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
- Current host-session theme, including validated runtime updates
- Survey-level theme
- Workspace branding defaults
- ResponseDock defaults