はじめに
このプラグインのインストール手順と完全なMarkdownガイドを含むセットアッププロンプトをコピー
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」セクションAIアシストセットアップを使ってプラグインをインストールできます。以下のコマンドで、お使いのAIツールに Capgo スキルを追加してください:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用します:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-navigation-bar` plugin in my project.手動セットアップを希望する場合は、以下のコマンドでプラグインをインストールし、下記のプラットフォーム別の手順に従ってください:
bun add @capgo/capacitor-navigation-barbunx cap syncインポート
「Import」セクションimport { NavigationBar } from '@capgo/capacitor-navigation-bar';クイックスタート
「Quick start」セクションナビゲーションバーをダークヘッダーとライトアイコンに合わせます。
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
await NavigationBar.setNavigationBarColor({ color: '#0f172a', darkButtons: false,});例:イマーシブリーダーモード
「例:イマーシブ・リーダーモード」セクションawait NavigationBar.hide();// later, when leaving the readerawait NavigationBar.show();例:現在のテーマを読み取る
「例:現在のテーマを読み取る」セクションconst { color, darkButtons } = await NavigationBar.getNavigationBarColor();よくある落とし穴
「Common pitfalls」セクション- Android のみ:このプラグインにはiOSのナビゲーションバーに相当する機能はありません。
- エッジ・トゥ・エッジ:ステータスバーやWebViewのsafe area CSSと組み合わせることで、バーが再表示された際にコンテンツが隠れるのを防げます。
API の概要
「API 概要」セクションsetNavigationBarColor
「setNavigationBarColor」セクションナビゲーションバーの色とボタンのテーマを設定します。
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
「getNavigationBarColor」セクション現在のナビゲーションバーの色とボタンのテーマを取得します。
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
const { color, darkButtons } = await NavigationBar.getNavigationBarColor();console.log('Current color:', color);console.log('Using dark buttons:', darkButtons);型リファレンス
「型リファレンス」セクションNavigationBarColor
「NavigationBarColor」セクション定義済みのナビゲーションバーの色。
export enum NavigationBarColor { /** White color */ WHITE = '#FFFFFF', /** Black color */ BLACK = '#000000', /** Transparent color */ TRANSPARENT = 'transparent',}信頼できる情報源
「信頼できる情報源」セクションこのページはプラグインの src/definitions.tsから生成されています。上流で公開 API が変更されたら、sync を再実行してください。
Getting Started から続ける
「Getting Started からの続き」セクション以下を使用している場合: はじめに ネイティブのメディアやインターフェースの挙動を計画するには、以下と連携させてください: @capgo/capacitor-navigation-bar を使用する場合 @capgo/capacitor-navigation-bar を使用したネイティブ機能について: @capgo/capacitor-live-activities の使用 @capgo/capacitor-live-activities を使用したネイティブ機能について、 @capgo/capacitor-live-activities @capgo/capacitor-live-activities の実装詳細について、 @capgo/capacitor-video-player の使用 @capgo/capacitor-video-player を使用したネイティブ機能、および @capgo/capacitor-video-player @capgo/capacitor-video-player. の実装詳細