Navigated to /docs/ui-core/api

UI Core API reference

Use the small public orchestration surface, public theme contracts, and color utilities exported by @tavojs/ui-core.

Theme orchestration

  • buildThemeTokens(config): validate and build the complete resolved theme result.

  • resolveThemeConfig(config): apply defaults, preset values, and explicit overrides.

  • resolveThemeBreakpoints(config): return required numeric sm, md, and lg thresholds.

  • resolveThemeViewport(config): return the resolved fluid viewport scale configuration.

TS
tsimport {
  buildThemeTokens,
  resolveThemeBreakpoints,
  resolveThemeConfig,
  resolveThemeViewport
} from "@tavojs/ui-core";

Public contracts

The package exports its config, result, color, mode, scale, typography, interaction, viewport, breakpoint, output, accessibility, ramp, and runtime-state types. Use these types at custom renderer and tooling boundaries instead of recreating partial interfaces.

TS
tsimport type {
  TavoUiThemeConfig,
  ThemeTokenBuildResult,
  ThemeResolvedColorSet,
  ThemePreset,
  ThemeMethod
} from "@tavojs/ui-core";

Color utilities

normalizeHex, hexToHsl, hslToHex, generateNeutralRamp, generateColorRamp, inferShade, relativeLuminance, readContrastColor, and contrastRatio are public for tools that need lower-level color inspection.