Skip to main content

Color Themes

The library ships nine colour palettes. Each palette is defined as a full MUI palette object and is used by buildTheme() to generate both a light and a dark theme variant.

Available palettes

Palette namePrimarySecondaryCharacter
aurora#6c63ff purple#ff6584 pinkDefault; vibrant, modern
ocean#0077b6 deep blue#00b4d8 cyanProfessional, calm
forest#2d6a4f deep green#52b788 mintNatural, trustworthy
sunset#e76f51 coral-orange#f4a261 amberEnergetic, warm
rose#c9184a deep rose#ff4d6d pink-redBold, expressive
slate#3d5a80 slate-blue#98c1d9 light blueNeutral, corporate
midnight#4a0e8f deep indigo#7b2d8b purpleDark, premium
coral#e63946 coral-red#f77f00 orangeUrgent, attention-grabbing
jade#087f5b jade-teal#40c057 leaf-greenFresh, eco

Import

import { PALETTES, type ThemePaletteName } from "@xocialive/ui-components/themes";

// Get a specific palette config
const auroraLight = PALETTES.aurora.light;
const auroraDark = PALETTES.aurora.dark;

Choosing a palette at runtime

Palette switching is handled by ThemeContext. Users pick a palette via the ThemeCustomizationDrawer (if your shell includes it), and the selection is persisted to localStorage.

import { useThemeContext } from "@xocialive/ui-components/contexts";

function PalettePicker() {
const { colorTheme, setColorTheme } = useThemeContext();

return (
<>
{(["aurora", "ocean", "forest", "sunset", "rose"] as ThemePaletteName[]).map((name) => (
<Button key={name} variant={colorTheme === name ? "contained" : "outlined"} onClick={() => setColorTheme(name)}>
{name}
</Button>
))}
</>
);
}