Skip to content

Safe area insets ​

Native hosts that render the platform edge to edge can provide explicit safe-area insets through ui.safeAreaInsets. Each value is a non-negative number in CSS pixels.

js
MindtrainingPlatform.init('mindtraining', {
  ui: {
    mode: 'app',
    safeAreaInsets: { top: 59, right: 0, bottom: 34, left: 0 },
  },
})

An explicit edge takes precedence over the corresponding CSS env(safe-area-inset-*) value. An omitted edge keeps the existing CSS fallback. Web mode continues to use 0px for the platform safe area, while app mode uses explicit values when present and CSS environment insets otherwise.

Insets can be updated with updateConfig(). Omitted edges keep their current explicit values:

js
MindtrainingPlatform.updateConfig({ ui: { safeAreaInsets: { top: 47 } } })

Use the actual host insets for the current device and orientation. The host should still allocate the platform only the space it owns; safe-area insets are not a replacement for correctly sizing the container between native navigation bars.

Client integration documentation maintained in-repo.