GuidesComponentsTheme

Multipliers

Configure spacing and border-radius calculation helpers

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

DEFAULT_MULTIPLIERS is the exported convenience value:

const DEFAULT_MULTIPLIERS = {
  spacing: 4,
  borderRadius: 4,
} as const;

Pass the values explicitly to ThemeProvider:

theme={{
  colors: DEFAULT_COLORS,
  dark: false,
  spacingMultiplier: DEFAULT_MULTIPLIERS.spacing,
  borderRadiusMultiplier: DEFAULT_MULTIPLIERS.borderRadius,
}}

The generated helpers are direct multiplication:

theme.spacing(4); // 16 with spacingMultiplier: 4
theme.borderRadius(2); // 8 with borderRadiusMultiplier: 4

The SDK does not choose responsive multipliers based on screen width. If an app wants tablet or compact values, it owns that configuration and supplies a new theme to the provider.

Last updated on