For the complete documentation index, see llms.txt. This page is also available as Markdown.

getSafeAreaInsets

Feature description

Synchronously gets the current Safe Area insets values. Use this to check the margins of areas where content may be obscured, such as notches or home indicators.

Type

getSafeAreaInsets(): SafeAreaInsets;

Params

None.

Response

type SafeAreaInsets = {
  top: number;
  left: number;
  right: number;
  bottom: number;
};

Example code

import { SafeArea } from "@apps-in-toss/web-framework";

const insets = SafeArea.get();

document.body.style.paddingTop = `${insets.top}px`;
document.body.style.paddingBottom = `${insets.bottom}px`;

Was this helpful?