Core SDK@pillar-ai/sdk
Theme
Customize colors, dark mode, and fonts.
typescript
import Pillar from '@pillar-ai/sdk'
Methods
Pillar.setTheme()
Update the theme at runtime. Use this to sync with your app's theme (e.g., dark mode toggle).
typescript
setTheme(theme: Partial<ThemeConfig>): void
Parameters
themerequiredPartial<ThemeConfig>
- Partial theme config to merge with current theme
Example
tsx
// Switch to dark modepillar.setTheme({ mode: 'dark' });// Switch to light mode with custom primary colorpillar.setTheme({ mode: 'light', colors: { primary: '#ff0000' } });// Let system preference decidepillar.setTheme({ mode: 'auto' });
Types
ThemeConfig
interfaceTheme configuration for customizing panel appearance
typescript
interface ThemeConfig {/*** Color mode: 'light', 'dark', or 'auto' (follows system preference)* @default 'auto'*/mode?: ThemeMode;/** Custom color overrides for light mode */colors?: ThemeColors;/** Custom color overrides for dark mode (when mode is 'auto' or 'dark') */darkColors?: ThemeColors;/*** Font family for all panel text.* @default "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"*/fontFamily?: string;}
Properties
modeThemeMode
Color mode: 'light', 'dark', or 'auto' (follows system preference)Defaults to
'auto'.colorsThemeColors
Custom color overrides for light mode
darkColorsThemeColors
Custom color overrides for dark mode (when mode is 'auto' or 'dark')
fontFamilystring
Font family for all panel text.Defaults to
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif".ThemeColors
interfaceTheme color configuration All colors should be valid CSS color values (hex, rgb, hsl, etc.)
typescript
interface ThemeColors {/** Primary brand color (buttons, links, accents) */primary?: string;/** Primary color on hover state */primaryHover?: string;/** Main background color */background?: string;/** Secondary/subtle background (inputs, cards) */backgroundSecondary?: string;/** Primary text color */text?: string;/** Muted/secondary text color */textMuted?: string;/** Border color */border?: string;/** Border color for subtle/light borders */borderLight?: string;}
Properties
primarystring
Primary brand color (buttons, links, accents)
primaryHoverstring
Primary color on hover state
backgroundstring
Main background color
backgroundSecondarystring
Secondary/subtle background (inputs, cards)
textstring
Primary text color
textMutedstring
Muted/secondary text color
borderstring
Border color
borderLightstring
Border color for subtle/light borders
ThemeMode
typetypescript
type ThemeMode = 'light' | 'dark' | 'auto'