Skip to content

capacitor plugin to get safeArea info on Android and IOS, support Capacitor3/Capacitor4

Notifications You must be signed in to change notification settings

chrisweight-elsewhen/capacitor-plugin-safe-area

 
 

Repository files navigation

capacitor-plugin-safe-area

a capacitor V3/V4 plugin to get SafeArea info on Android and IOS

if you are use Capacitor 3.x , please install version 0.0.x , and version 1.x.x for Capacitor 4.x

I'm glad if this plugin helped you, please give it a star

Install

npm install capacitor-plugin-safe-area
npx cap sync

Useage

import { SafeArea } from 'capacitor-plugin-safe-area';

SafeArea.getSafeAreaInsets().then(({ insets }) => {
  console.log(insets);
});

SafeArea.getStatusBarHeight().then(({statusBarHeight}) => {
  console.log(statusBarHeight, 'statusbarHeight');
})

API

getSafeAreaInsets()

getSafeAreaInsets() => Promise<SafeAreaInsets>

Returns: Promise<SafeAreaInsets>


getStatusBarHeight()

getStatusBarHeight() => Promise<StatusBarInfo>

Returns: Promise<StatusBarInfo>


Interfaces

SafeAreaInsets

Prop Type
insets SafeArea

SafeArea

Prop Type
top number
right number
bottom number
left number

StatusBarInfo

Prop Type
statusBarHeight number

About

capacitor plugin to get safeArea info on Android and IOS, support Capacitor3/Capacitor4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 26.6%
  • Java 26.6%
  • Swift 20.9%
  • TypeScript 8.1%
  • HTML 6.9%
  • Ruby 5.9%
  • Other 5.0%