Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-navigation-bar`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/navigation-bar/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Install
Section titled “Install”You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsThen use the following prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-navigation-bar` plugin in my project.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-navigation-barbunx cap syncImport
Section titled “Import”import { NavigationBar } from '@capgo/capacitor-navigation-bar';Quick start
Section titled “Quick start”Match the navigation bar to a dark header and light icons.
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
await NavigationBar.setNavigationBarColor({ color: '#0f172a', darkButtons: false,});Example: immersive reader mode
Section titled “Example: immersive reader mode”await NavigationBar.hide();// later, when leaving the readerawait NavigationBar.show();Example: read current theme
Section titled “Example: read current theme”const { color, darkButtons } = await NavigationBar.getNavigationBarColor();Common pitfalls
Section titled “Common pitfalls”- Android only: there is no iOS navigation bar equivalent in this plugin.
- Edge to edge: combine with your status bar and WebView safe area CSS so content is not covered when the bar is shown again.
API Overview
Section titled “API Overview”setNavigationBarColor
Section titled “setNavigationBarColor”Set the navigation bar color and button theme.
import { NavigationBar, NavigationBarColor } from '@capgo/capacitor-navigation-bar';
// Set to white with dark buttonsawait NavigationBar.setNavigationBarColor({ color: NavigationBarColor.WHITE, darkButtons: true});
// Set to custom colorawait NavigationBar.setNavigationBarColor({ color: '#FF5733', darkButtons: false});
// Set a custom divider color on Android 9+await NavigationBar.setNavigationBarColor({ color: NavigationBarColor.WHITE, darkButtons: true, dividerColor: '#D9D9D9'});getNavigationBarColor
Section titled “getNavigationBarColor”Get the current navigation bar color and button theme.
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
const { color, darkButtons } = await NavigationBar.getNavigationBarColor();console.log('Current color:', color);console.log('Using dark buttons:', darkButtons);Type Reference
Section titled “Type Reference”NavigationBarColor
Section titled “NavigationBarColor”Predefined navigation bar colors.
export enum NavigationBarColor { /** White color */ WHITE = '#FFFFFF', /** Black color */ BLACK = '#000000', /** Transparent color */ TRANSPARENT = 'transparent',}Source Of Truth
Section titled “Source Of Truth”This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.
Keep going from Getting Started
Section titled “Keep going from Getting Started”If you are using Getting Started to plan native media and interface behavior, connect it with Using @capgo/capacitor-navigation-bar for the native capability in Using @capgo/capacitor-navigation-bar, Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player, and @capgo/capacitor-video-player for the implementation detail in @capgo/capacitor-video-player.