Every colour, type step, spacing unit and corner radius in the library comes from one token set, resolved for the light and dark schemes. These swatches are the live values of the theme this page is rendered with.
Showing the light scheme.
Colour sets
Twenty-two colour sets: the Material 3 baseline, the hand-authored Databeasy and inXpire brand sets, and the nineteen named Material hues run through the same role mapping from their seed. Picking one re-themes the whole site — every page, every component demo — because the library resolves its tokens from the selected set.
Everything the picker above does is public API. The set shown right now is `palettes.baseline`, seeded from #6750A4.
App.tsx
import { ThemeProvider, palettes } from"@its/glowup-ui";
// The colour set the app starts on. Both schemes come with it: the provider// still follows the OS light/dark setting and `toggleTheme()`.exportdefaultfunctionApp() {
return (
<ThemeProviderinitialPalette={palettes.teal}>
<Root />
</ThemeProvider>
);
}
PaletteMenu.tsx
import { palettes, useTheme } from"@its/glowup-ui";
// Swapping the set at runtime re-renders every component that reads the theme// — this picker is exactly this call.constPaletteMenu = () => {
const { palette, setPalette } = useTheme();
returnObject.values(palettes).map((p) => (
<Chipkey={p.id} selected={p.id === palette.id} onPress={() => setPalette(p)}>
{p.name}
</Chip>
));
};
Your own colours
A seed colour is enough — the tonal palettes and the role mapping are Material 3's. A palette authored by hand is the same shape, so either route ends at the same `initialPalette` prop.
brand.ts
import { createPalette, ThemeProvider } from"@its/glowup-ui";
// One brand colour in, both complete schemes out: primary, secondary and// tertiary tonal palettes plus the neutrals, mapped onto the M3 roles. Error// stays the fixed Material red, as the spec requires.const brand = createPalette("#00639B", { id: "brand", name: "Brand" });
// Tune how saturated the derived palettes are, if the default reads too calm:const vivid = createPalette("#00639B", {
id: "brand-vivid",
name: "Brand (vivid)",
chroma: { primary: 64, tertiary: 32, tertiaryHueShift: 120 },
});
<ThemeProviderinitialPalette={brand}>…</ThemeProvider>;
corporate.ts
import { palettes, typeThemePalette } from"@its/glowup-ui";
// Nothing is derived here: a palette is just the token set for both schemes,// so a hand-authored one — from Material Theme Builder, say — drops straight// in. Spread a shipped palette to fill in the roles you do not override.const corporate: ThemePalette = {
id: "corporate",
name: "Corporate",
seed: "#00639B",
light: { ...palettes.baseline.light, primary: "#00639B", onPrimary: "#FFFFFF" },
dark: { ...palettes.baseline.dark, primary: "#95CCFF", onPrimary: "#003354" },
};