Skip to content

CustomTheme

Defined in: src/types/index.ts:365

A colour/typography theme for diagram rendering.

Every field is optional. Whatever is omitted comes from the built-in theme named by base ('light' unless set), so a theme that only changes fontSize, or one state type’s fill, is a one-line object. A fully specified theme still works as before.

const bigDark: CustomTheme = { base: 'dark', fontSize: 18 };
const greenTasks: CustomTheme = { nodeColors: { Task: { fill: '#e8f5e9' } } };
optional background?: string;

Defined in: src/types/index.ts:366


optional base?: "light" | "dark";

Defined in: src/types/index.ts:368

Built-in theme the omitted fields are taken from. Defaults to 'light'.


optional edgeColors?: Partial<{
choice: string;
default: string;
error: string;
normal: string;
retry?: string;
}>;

Defined in: src/types/index.ts:369


optional fontFamily?: string;

Defined in: src/types/index.ts:370


optional fontSize?: number;

Defined in: src/types/index.ts:371


optional nodeColors?: Partial<Record<StateType, Partial<{
fill: string;
stroke: string;
}>>>;

Defined in: src/types/index.ts:372


optional textColor?: string;

Defined in: src/types/index.ts:373