a capacitor V3/V4 plugin to get safeArea info on Android and IOS
npm install capacitor-plugin-safe-area
npx cap sync
import { SafeArea } from 'capacitor-plugin-safe-area';
SafeArea.getSafeAreaInsets().then(({ insets }) => {
console.log(insets);
});
SafeArea.getStatusBarHeight().then(({statusBarHeight}) => {
console.log(statusBarHeight, 'statusbarHeight');
})
getSafeAreaInsets() => Promise<SafeAreaInsets>
Returns: Promise<SafeAreaInsets>
getStatusBarHeight() => Promise<StatusBarInfo>
Returns: Promise<StatusBarInfo>
Prop | Type |
---|---|
insets |
SafeArea |
Prop | Type |
---|---|
top |
number |
right |
number |
bottom |
number |
left |
number |
Prop | Type |
---|---|
statusBarHeight |
number |