Démarrage
Copiez une commande de configuration avec les étapes d'installation et la guide markdown complète pour ce 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.
Installer
Installationbun add @capgo/capacitor-navigation-barbunx cap syncImporter
Section intitulée « Importer »import { NavigationBar } from '@capgo/capacitor-navigation-bar';API Vue d'ensemble
Section intitulée « API Vue d'ensemble »setNavigationBarColor
Section intitulée « setNavigationBarColor »Définir la couleur de la barre de navigation et le thème du bouton.
import { NavigationBar } 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 intitulée « getNavigationBarColor »Obtenir la couleur actuelle de la barre de navigation et le thème du bouton.
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
const { color, darkButtons } = await NavigationBar.getNavigationBarColor();console.log('Current color:', color);console.log('Using dark buttons:', darkButtons);Référence de type
Section intitulée « Référence de type »NavigationBarColor
Section intitulée « Couleur de la barre de navigation »Couleurs de la barre de navigation prédéfinies.
export enum NavigationBarColor { /** White color */ WHITE = '#FFFFFF', /** Black color */ BLACK = '#000000', /** Transparent color */ TRANSPARENT = 'transparent',}Source de vérité
Section intitulée « Source de vérité »Cette page est générée à partir du plugin’s src/definitions.tsRe-run the sync when the public API changes upstream.