Skip to content

Theming

Theme Options

OptionTypeDescription
primarystringPrimary brand color (hex)
accentstringAccent color (hex)
backgroundstringBackground color (hex)
foregroundstringText color (hex)
cardstringCard background color (hex)
borderstringBorder color (hex)
radiusnumberBorder radius in pixels
darkModebooleanEnable dark mode

Basic Theming

Basic Themetypescript
const _si = new SpaceInvoices({
  apiKey: "ek_live_...",
  entityId: "ent_123",
  theme: {
    primary: "#6366f1", // Indigo
    radius: 8,
  },
});

Dark Mode

Dark Modetypescript
const _si = new SpaceInvoices({
  apiKey: "ek_live_...",
  entityId: "ent_123",
  theme: {
    primary: "#818cf8",
    darkMode: true,
  },
});

Full Customization

Full Theme Customizationtypescript
const _si = new SpaceInvoices({
  apiKey: "ek_live_...",
  entityId: "ent_123",
  theme: {
    primary: "#6366f1", // Primary buttons, links
    accent: "#8b5cf6", // Accents
    background: "#ffffff", // Page background
    foreground: "#1a1a1a", // Text color
    card: "#ffffff", // Card backgrounds
    border: "#e5e5e5", // Borders
    radius: 8, // Border radius (px)
    darkMode: false,
  },
});

Dynamic Theme Updates

Update the theme after initialization:

Dynamic Theme Updatetypescript
// Update primary color
si.updateTheme({
  primary: "#10b981",
});

// Switch to dark mode
si.updateTheme({
  primary: "#818cf8",
  darkMode: true,
});

// Reset to light mode
si.updateTheme({
  darkMode: false,
});

Theme Presets

Light Theme

theme: {
primary: '#6366f1',
accent: '#8b5cf6',
background: '#ffffff',
foreground: '#1a1a1a',
card: '#ffffff',
border: '#e5e5e5',
radius: 8,
darkMode: false,
}

Dark Theme

theme: {
primary: '#818cf8',
accent: '#a78bfa',
background: '#0a0a0a',
foreground: '#fafafa',
card: '#171717',
border: '#262626',
radius: 8,
darkMode: true,
}

Next Steps