Skip to main content

cordova-plugin-navigationbar Alternative for Capacitor

cordova-plugin-navigationbar alternative for Capacitor: hide, show and theme the Android navigation bar with @capgo/capacitor-navigation-bar.

Illustration of migrating a Cordova app to Capacitor, used for an Android navigation bar plugin guide

The practical cordova-plugin-navigationbar alternative for a Capacitor app is @capgo/capacitor-navigation-bar. It covers Android immersive hide and show, adds navigation bar color and light or dark button themes, and returns the current color without cordova.exec callbacks. This guide lists npm facts, install steps, usage, and a Cordova to Capacitor API map.

Why leave cordova-plugin-navigationbar in Capacitor

cordova-plugin-navigationbar on npm is version 1.0.31. The last numbered release on the npm time object is 25 February 2016. The registry modified timestamp is 14 June 2022 (metadata only, not a new plugin version). The npm repository URL points to cranberrygame/cordova-plugin-navigationbar.

The JavaScript bridge in www/navigationbar.js exposes:

  • setUp(autoHideNavigationBar, success, error) to configure auto-hide behavior
  • hideNavigationBar(success, error) to hide the bar

Examples in the upstream repo sometimes call window.navigationbar.hide(), but the published module actions are setUp and hideNavigationBar. There is no show API, no color API, and no promise surface in the Cordova package.

@capgo/capacitor-navigation-bar latest on npm is 8.2.23 with a modified date of 13 November 2026. src/definitions.ts documents hide, show, setNavigationBarColor, getNavigationBarColor, and optional dividerColor on Android API 28+. Capgo ships fixes on an open source cadence where a human still reviews, tests and merges 50+ pull requests daily.

Install

The command below installs the npm 8.x line for Capacitor 8 (@capacitor/core >= 8). Capgo plugin majors track Capacitor majors. On Capacitor 7, install the matching 7.x release instead (see the plugin README). The hide() and show() methods require plugin 8.2.0 or later. No 7.x release provides them, so the hide/show examples in this article do not compile on Capacitor 7.

bun add @capgo/capacitor-navigation-bar
bunx cap sync

Optional defaults in capacitor.config under plugins.NavigationBar can set color, dividerColor, and style before the WebView loads. See the navigation bar plugin docs.

Usage example

import { Capacitor } from '@capacitor/core';
import { NavigationBar, NavigationBarColor } from '@capgo/capacitor-navigation-bar';

export async function enterImmersiveReader() {
  if (Capacitor.getPlatform() !== 'android') return;
  await NavigationBar.setNavigationBarColor({
    color: NavigationBarColor.BLACK,
    darkButtons: false,
  });
  await NavigationBar.hide();
}

export async function exitImmersiveReader() {
  if (Capacitor.getPlatform() !== 'android') return;
  await NavigationBar.show();
  const { color, darkButtons } = await NavigationBar.getNavigationBarColor();
  console.log(color, darkButtons);
}

Pair navigation bar theming with edge-to-edge display configuration so your WebView content respects system insets when the bar returns.

Migrating from Cordova to Capacitor

// Before (Cordova)
document.addEventListener('deviceready', () => {
  window.navigationbar.setUp(false, success, error);
  window.navigationbar.hideNavigationBar(success, error);
});
// After (Capacitor), enter immersive screen
import { Capacitor } from '@capacitor/core';
import { NavigationBar } from '@capgo/capacitor-navigation-bar';

if (Capacitor.getPlatform() === 'android') {
  await NavigationBar.setNavigationBarColor({ color: '#0f172a', darkButtons: false });
  await NavigationBar.hide();
}
// After (Capacitor), leave immersive screen
if (Capacitor.getPlatform() === 'android') {
  await NavigationBar.show();
}

Cordova setUp(true, ...) only toggles auto-hide on the native side. In Capacitor you implement auto-hide in app logic: call hide() when entering fullscreen and show() when leaving, or listen to your router and keyboard events.

API mapping table

cordova-plugin-navigationbar (window.navigationbar) @capgo/capacitor-navigation-bar
setUp(autoHide, success, error) No direct equivalent; use hide() / show() in app code, or config plugins.NavigationBar defaults
hideNavigationBar(success, error) hide()
Not in Cordova show()
Not in Cordova setNavigationBarColor({ color, darkButtons?, dividerColor? })
Not in Cordova getNavigationBarColor() returns { color, darkButtons }
Not in Cordova getPluginVersion()
Cordova plugin install bun add @capgo/capacitor-navigation-bar plus bunx cap sync

Navigation bar behavior ships in the native binary. Use Capgo Build for store builds, then adjust immersive layouts with Capgo live updates where only JavaScript changes. For the full platform move, read the Cordova to Capacitor migration guide.

Live updates for Capacitor apps

When a web-layer bug is live, ship the fix through Capgo instead of waiting days for app store approval. Users get the update in the background while native changes stay in the normal review path.

Latest from our Blog

Capgo gives you the best insights you need to create a truly professional mobile app.