Skip to main content
Screen, Header, TabBar and Sheet already handle the safe area. You only need this page when you build fixed or full-bleed UI yourself. In a shell, the host reports its insets over the bridge (app.insets). In a browser, the CSS env(safe-area-inset-*) values apply. The helpers below combine both, so you never have to choose.

In CSS

UIProvider publishes the shell’s insets on its wrapper as --cskn-inset-top, -right, -bottom and -left. insetCss builds an expression that takes the largest of the shell value, the browser value and an optional minimum:

In JavaScript

Outside React: getInsets() and onInsetsChange(cb), which returns an unsubscribe function. startInsetVars() writes the --cskn-inset-* variables onto the document root if you are not using UIProvider.
In a browser no inset message arrives, so the JavaScript values stay 0. Prefer insetCss, which falls back to env(safe-area-inset-*), for anything that must also work in a browser.