UI Preset System API Reference
This reference documents the type definitions, interfaces, and helper functions comprising the Framework M UI Preset System.
1. UIPreset Interface
export interface UIPreset {
name: string;
tokens?: MThemeTokens;
themes?: MThemeMap;
}
Properties
name(string, required): Unique identifier for the preset (e.g."frappe","standard").tokens(MThemeTokens, optional): Token scale overrides for colors, radii, sizes, and spacing.themes(MThemeMap, optional): Mode-specific theme overrides forlightanddarkmodes.
2. MThemeTokens Interface
export interface MThemeTokens {
color?: Partial<Record<string, string>>;
radius?: Partial<Record<string, number>>;
size?: Partial<Record<string, number>>;
space?: Partial<Record<string, number>>;
}
3. buildMThemeConfig(preset?: UIPreset) Helper
Generates a complete Tamagui design configuration by deep-merging preset token and theme overrides into Framework M's default design configuration.
import { buildMThemeConfig, frappePreset } from "@framework-m/ui";
const config = buildMThemeConfig(frappePreset);
4. Built-in Presets
frappePreset
Preset package replicating Frappe UI v15 visual standards:
- Primary Light Accent:
#111827(Solid Black button with#fffffftext) - Primary Dark Accent:
#fafafa(Clean White button with#121212text) - Dark Background:
#121212(Pure Black, Zero Blue Tinting) - Active Sidebar Highlight:
#ffffffin Light Mode,#27272ain Dark Mode. - Radii Scale:
md: 6pxfor inputs and buttons.