Skip to content

Safe area

Obtain safe area information (parsed from UserAgent) to adapt to devices such as notched screens and full-screen displays.

const safeArea = SuperSDK.getSafeArea();
console.log(safeArea);
// { top: 88, bottom: 34 }
// top: Status bar height (physical pixels)
// bottom: Navigation bar height (physical pixels)

Return Value:

ParameterTypeDescription
topnumberStatus bar safe area height (physical pixels)
bottomnumberNavigation bar safe area height (physical pixels)

Note: This method is synchronous and returns the result directly. The safe area information is injected by the client via the UserAgent (SafeAreaTop/xx SafeAreaBottom/xx). Correct values can only be obtained after the client calls setSafeArea or fitSystemWindows.