Theming
Overview
Customize the appearance of SDK components to match your brand. Themes can be applied globally or per-component.
Theme Configuration
interface ThemeConfig {
primaryColor?: string; // Primary brand color
secondaryColor?: string; // Secondary/accent color
backgroundColor?: string; // Background color
textColor?: string; // Primary text color
borderColor?: string; // Border color
errorColor?: string; // Error state color
successColor?: string; // Success state color
fontFamily?: string; // Font family
borderRadius?: string; // Border radius
}Applying Themes
Global Theme (Client Level)
Apply a theme to all components created by the client:
Per-Component Theme
Override the global theme for a specific component:
Theme Properties
Colors
primaryColor
Buttons, links, primary actions
#0066cc
secondaryColor
Secondary elements, accents
#6b7280
backgroundColor
Component background
#ffffff
textColor
Primary text color
#1a1a1a
borderColor
Borders and dividers
#e5e7eb
errorColor
Error states, validation
#ef4444
successColor
Success states
#22c55e
Typography
fontFamily
Font stack
Inter, system-ui, sans-serif
Spacing & Shape
borderRadius
Corner radius
8px
Preset Themes
Default
Dark Mode
Purple
Example: Custom Branded Theme
CSS Custom Properties
The SDK uses CSS custom properties internally. You can also override styles using CSS:
CSS overrides may break in future SDK versions. Prefer using the theme configuration when possible.
Live Theme Editor
The SDK examples include a live theme editor for testing different color combinations. Run the examples locally to experiment with themes before implementing.
Then visit http://localhost:5173/custom-theme.html to use the interactive theme editor.
Last updated
Was this helpful?
