🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@matiasfic/capacitor-android-edge-to-edge-support

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matiasfic/capacitor-android-edge-to-edge-support

Capacitor plugin to support edge-to-edge display on Android.

latest
Source
npmnpm
Version
7.2.3
Version published
Maintainers
1
Created
Source

@capawesome/capacitor-android-edge-to-edge-support

Capacitor plugin to support edge-to-edge display on Android with advanced features like setting the background color of the status bar and navigation bar.

BeforeAfterBeforeAfter

Installation

npm install @capawesome/capacitor-android-edge-to-edge-support
npx cap sync

Android

If you are using the Capacitor Keyboard plugin, make sure to set the resizeOnFullScreen property to false (default) in your Capacitor Configuration file:

{
  "plugins": {
    "Keyboard": {
      "resizeOnFullScreen": false
    }
  }
}

Otherwise, the web view will be resized to fit the screen, which may cause issues with this plugin, see this comment.

Configuration

PropTypeDescriptionSince
backgroundColorstringThe hexadecimal color to set as the background color of the status bar and navigation bar.7.1.0

Examples

In capacitor.config.json:

{
  "plugins": {
    "EdgeToEdge": {
      "backgroundColor": "#ffffff"
    }
  }
}

In capacitor.config.ts:

/// <reference types="@matiasfic/capacitor-android-edge-to-edge-support" />

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  plugins: {
    EdgeToEdge: {
      backgroundColor: "#ffffff",
    },
  },
};

export default config;

Usage

The plugin only needs to be installed. It applies insets to the web view to support edge-to-edge display on Android. The plugin also provides a method to set the background color of the status bar and navigation bar. It's recommended to use this method in combination with the Status Bar plugin.

import { EdgeToEdge } from '@capawesome/capacitor-android-edge-to-edge-support';
import { StatusBar, Style } from '@capacitor/status-bar';

const enable = async () => {
  await EdgeToEdge.enable();
};

const disable = async () => {
  await EdgeToEdge.disable();
};

const getInsets = async () => {
  const result = await EdgeToEdge.getInsets();
  console.log('Insets:', result);
};

const setBackgroundColor = async () => {
  await EdgeToEdge.setBackgroundColor({ color: '#ffffff' });
  await StatusBar.setStyle({ style: Style.Light });
};

API

enable()

enable() => Promise<void>

Enable the edge-to-edge mode.

Only available on Android.

Since: 7.2.0

disable()

disable() => Promise<void>

Disable the edge-to-edge mode.

Only available on Android.

Since: 7.2.0

getInsets()

getInsets() => Promise<GetInsetsResult>

Return the insets that are currently applied to the webview.

Only available on Android.

Returns: Promise<GetInsetsResult>

Since: 7.2.0

setBackgroundColor(...)

setBackgroundColor(options: SetBackgroundColorOptions) => Promise<void>

Set the background color of the status bar and navigation bar.

Only available on Android.

ParamType
optionsSetBackgroundColorOptions

Since: 7.0.0

Interfaces

GetInsetsResult

PropTypeDescriptionSince
bottomnumberThe bottom inset that was applied to the webview. Only available on Android.7.2.0
leftnumberThe left inset that was applied to the webview. Only available on Android.7.2.0
rightnumberThe right inset that was applied to the webview. Only available on Android.7.2.0
topnumberThe top inset that was applied to the webview. Only available on Android.7.2.0

SetBackgroundColorOptions

PropTypeDescriptionSince
colorstringThe hexadecimal color to set as the background color of the status bar and navigation bar.7.0.0

Changelog

See CHANGELOG.md.

License

See LICENSE.

Keywords

capacitor

FAQs

Package last updated on 11 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts