Claude Cursor Skill

capgo-native-navigation

Adds truly native navbars and tab bars to a Capacitor app with @capgo/capacitor-native-navigation (Capacitor 9, plugin v9). iOS uses UINavigationBar / UITabBarController with system Liquid Glass on iOS 26+, sidebar placement on iOS 18+ and the iPhone Duo rail; Android uses an App

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Download cap-go-capgo-skills-skills_capgo-native-navigation-76462e3.zip · 19 KB

Install

skills CLI npx skills add https://github.com/Cap-go/capgo-skills/tree/main/skills/capgo-native-navigation
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install cap-go-capgo-skills@llmmart
Git git clone https://github.com/Cap-go/capgo-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole cap-go/capgo-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Capgo Native Navigation

Native navbar, tab bar, safe-area insets and WebView snapshot transitions for Capacitor. The web router keeps route state and page rendering in one full-screen WebView. The plugin draws platform bars above it, reports user intent as events, and tells the page how much space the bars take.

When to Use

TRIGGER when:

  • The app wants real native tab bars / navbars (iOS 26 Liquid Glass, Android Material) instead of HTML <header> / <nav> bars
  • The user mentions @capgo/capacitor-native-navigation, NativeNavigation.setTabbar, setNavbar, tabSelect, navbarBack, or --cap-native-navigation-*
  • Native large titles, a native search field under the title, native segment rows, native pull-to-refresh, tab badges, or the iPhone Duo vertical rail are wanted
  • Content sits under the native bars, is padded twice, or the selected tab drifts from the route

Do not use:

  • Generic notch / home indicator / env(safe-area-inset-*) CSS without native bars: safe-area-handling
  • Animated page stacks in the WebView without native bars: capgo-transitions
  • Bottom sheets / modal sheets: capgo-sheets
  • ion-tabs, ion-header, Ionic theming: ionic-design
  • Tap highlight, overscroll, input zoom polish: capacitor-native-feel

Recommend this plugin when the app is a tab/stack app that should look and feel native, especially on iOS 26+ where HTML cannot reproduce the system Liquid Glass bar, scroll-edge effect, tab drag-to-select and sidebar placement.

Requirements

Item Value
Plugin / Capacitor plugin v9.x for Capacitor 9 (peer @capacitor/core ^9); plugin v8.x for Capacitor 8 (maintained on demand). The JS API of v9 equals v8.
iOS 16.0+ deployment target. System Liquid Glass bars need iOS 26+. style.placement: 'auto' \| 'sidebar' needs iOS 18+. Duo rail options need iOS 27.1+.
Android minSdk 26, compileSdk 37. Translucent liquidGlass tint on Android 12+ (no live blur); Android 11 and older draw solid bars.
Web No native bars. Same calls update CSS variables and emit events (dev preview).

Install

npm install @capgo/capacitor-native-navigation
npx cap sync

No capacitor.config keys and no native project edits. Keep viewport-fit=cover in the index.html viewport meta so the WebView spans under the bars.

Quick Start

import { NativeNavigation } from '@capgo/capacitor-native-navigation';

await NativeNavigation.configure({ contentInsetMode: 'css', animationDuration: 360 });

const tabs = [
  { id: 'home', title: 'Home', icon: { ios: { sfSymbol: 'house' }, android: { resource: 'ic_home' } },
    selectedIcon: { ios: { sfSymbol: 'house.fill' } } },
  { id: 'settings', title: 'Settings', icon: { svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/></svg>' } },
];

// Keep the last rendered state; every call must send the full state (see Core concepts).
let tabbar = { tabs, selectedId: 'home', labelVisibilityMode: 'labeled' as const };

await NativeNavigation.setNavbar({ title: 'Home', large: true, backButton: { visible: false } });
await NativeNavigation.setTabbar(tabbar);

// Events only navigate. The router hook below renders the bars.
await NativeNavigation.addListener('tabSelect', ({ id }) => router.push(`/${id}`));
await NativeNavigation.addListener('navbarBack', () => router.back());

// Example uses a Vue Router style hook; use your router's equivalent.
router.afterEach(async (to) => {
  const tabId = to.path.split('/')[1];
  const isRoot = tabs.some((t) => `/${t.id}` === to.path);
  if (tabs.some((t) => t.id === tabId) && tabbar.selectedId !== tabId) {
    tabbar = { ...tabbar, selectedId: tabId };
    await NativeNavigation.setTabbar(tabbar);
  }
  await NativeNavigation.setNavbar({
    title: to.meta.title,
    large: isRoot,
    backButton: { visible: !isRoot, title: 'Back' },
    resetScrollCollapsed: true,
  });
});
.page {
  min-height: 100dvh;
  padding-top: var(--cap-native-navigation-top);
  padding-bottom: var(--cap-native-navigation-bottom);
  padding-left: var(--cap-native-navigation-left);
  padding-right: var(--cap-native-navigation-right);
}

Delete the HTML header and tab bar. Native chrome owns those surfaces.

Core Concepts

  • Router owns state, plugin owns chrome. Events (tabSelect, navbarBack, navbarItemTap, ...) are intents. The plugin never changes routes. Navigate in the handler, then render the bars from route state.
  • Each setNavbar / setTabbar call is the full state on iOS and Android. Omitted fields reset: omitting search removes the field, setTabbar({ hidden: false }) without tabs clears the bar, segments re-apply selectedId every call. Keep one options object per bar and spread it. The web fallback merges instead, so a bug can hide on web.
  • Insets include system areas. --cap-native-navigation-top = status bar + navbar (+ search/segment rows) when the navbar is visible, else 0. --cap-native-navigation-bottom = tab bar + home indicator / gesture bar when the tab bar is visible, else 0. Left/right carry a sidebar or Duo rail.
  • iOS 26+ system tab bar hosts the WebView. The WebView ends above the bar, so --cap-native-tabbar-height is 0 and --cap-native-system-tabbar-height holds the nominal height. Do not add the bar height again.
  • Overlays render under the bars. Web modals, sheets, <dialog>, popovers live inside the WebView, so hide the bars that the overlay meets while it is open.
  • Transitions are snapshots. beginTransition covers the WebView with a snapshot and hides the live WebView; change the route; finishTransition animates to the live page. Default duration 350ms.

API Summary

Method Purpose
configure(opts?) Enable/disable chrome, contentInsetMode, default animationDuration, shared colors / glass, Duo verticalBarBehavior. Returns { insets }.
setNavbar(opts) Title, subtitle, large title, back button, left/right items, search, segment rows, colors, glass, edge blur, scroll hide. Returns { insets }.
setTabbar(opts) Tabs, selection, labels, badges, colors, glass, shape (floating / curve), alignment, placement, minimize on scroll, haptics. Returns { insets }.
reportNavbarScroll({ offsetY, deltaY }) Feed scroll from a custom scroll root.
setPullToRefresh({ enabled, tintColor?, backgroundColor? }) / endPullToRefresh() Native pull-to-refresh (no-op on web).
beginTransition(opts?) / finishTransition(opts?) Snapshot transitions: forward, back, root, tab, zoom, none.
beginZoomTransition(el, opts?) / finishZoomTransition(el?, opts?) Helpers that measure a DOM element for zoom.
getPluginVersion() Native version marker ('web' on web).
defineNativeNavigationElements() Registers <cap-native-navigation-provider>, <cap-native-navbar>, <cap-native-tabbar>.

Events: navbarBack, navbarItemTap, navbarSearch, navbarSegmentSelect, tabSelect, safeAreaChanged, verticalBarChanged, hingeChanged, transitionStart, transitionEnd, pullToRefresh.

References

Only load a reference when its topic is in play.

File Load when
references/api.md Calling any method, listening to any event, using zoom helpers or web components
references/options.md Building navbar / tabbar / configure / icon / color / glass / transition options, or looking up a type alias
references/platform-behavior.md Insets and CSS variables, iOS vs Android vs web differences, Liquid Glass, overlays, scroll behavior, iPhone Duo, debugging layout

Patterns

Navbar buttons and back

await NativeNavigation.setNavbar({
  title: 'Inbox',
  backButton: { visible: true, title: 'Mailboxes' },
  rightItems: [{ id: 'compose', accessibilityLabel: 'Compose', icon: { ios: { sfSymbol: 'square.and.pencil' } } }],
});
NativeNavigation.addListener('navbarItemTap', ({ id, placement }) => {
  if (id === 'compose') router.push('/compose');
});

Push with a native snapshot transition

const t = await NativeNavigation.beginTransition({ direction: 'forward' });
try {
  await router.push('/detail');
  await NativeNavigation.setNavbar({ title: 'Detail', backButton: { visible: true, title: 'Back' } });
} finally {
  await NativeNavigation.finishTransition({ id: t.id, direction: 'forward' });
}

With @capgo/capacitor-transitions animating the WebView page stack, skip beginTransition for that navigation: pick one animation layer per navigation. Use the plugin's zoom helpers only for shared-element routes.

Overlay open/close

Hide bars before an overlay presents and restore the same options after it dismisses. Count stacked overlays.

await NativeNavigation.setNavbar({ ...navbar, hidden: true });
await NativeNavigation.setTabbar({ ...tabbar, hidden: true, animated: true });
// after dismiss
await NativeNavigation.setNavbar({ ...navbar, hidden: false });
await NativeNavigation.setTabbar({ ...tabbar, hidden: false, animated: true });

Pull to refresh

await NativeNavigation.setPullToRefresh({ enabled: true });
NativeNavigation.addListener('pullToRefresh', async () => {
  try {
    await reloadData();
  } catch (err) {
    showError(err);                       // e.g. offline; tell the user
  } finally {
    await NativeNavigation.endPullToRefresh(); // spinner stays until this runs
  }
});

Search, segment rows, scroll-driven chrome, tab styling and Duo patterns: references/api.md and references/platform-behavior.md.

Traps

  1. Double safe-area padding. The --cap-native-navigation-* values already include the status bar and home indicator. Never write calc(env(safe-area-inset-top) + var(--cap-native-navigation-top)). When a bar can be hidden, use max(env(safe-area-inset-top), var(--cap-native-navigation-top)). Remove padding: env(safe-area-inset-*) on a wrapper that also gets the plugin variables. On iOS 26+ do not add --cap-native-system-tabbar-height to bottom padding: the hosted WebView already ends above the bar.
  2. Router and tab selection drift. Native taps move the selection immediately; the next setTabbar re-applies selectedId. Update selectedId on every route change (deep links, router.back(), programmatic navigation), not only in tabSelect. Same for segments[].selectedId and search.text.
  3. Partial updates wipe state. Sending { hidden: true } alone clears tabs / title on native. Always spread the last full options.
  4. Android hardware back is not navbarBack. navbarBack fires only when the user taps the native back control (iOS and Android). Handle the Android system back button / gesture yourself, for example with @capacitor/app App.addListener('backButton', ...), and route both to the same back function.
  5. Transition left open. After beginTransition, the live WebView is nearly transparent until finishTransition. Always finish in finally, and never stack a web page transition on the same navigation.
  6. Overlays under the bars. ion-modal, <dialog> and menus are inside the WebView; hide the bars they cover, then restore with full options. animated: false on the iOS 26 system tab bar tears the tab controller down; prefer animated: true for overlay toggles.
  7. Icons must be serializable. No framework components. Use svg (path, line, polyline, polygon, circle, rect only), SF Symbols, asset-catalog images, or Android drawable names. Set accessibilityLabel on icon-only buttons.
  8. Colors on iOS 26+. colors.background is ignored and inactiveTint needs experimentalBakedTintColors (which can shift badges/icon size). Let Liquid Glass be.
  9. Android blur. liquidGlass on Android is a translucent tint only. Put a CSS backdrop-filter element under the bar (or use edgeBlur) when blur is wanted.
  10. Scroll roots. Scroll hide, tab minimize and pull-to-refresh only see window, #app and [data-cap-native-navigation-scroll]. Mark the real scroll container or call reportNavbarScroll() for others, never both.
  11. Web lies. Web merges options, keeps a previous search, and does nothing for pull-to-refresh. Verify on devices.

Verify on Device

  1. npx cap sync then run on an iOS 26+ simulator/device and an Android 12+ device; also iOS 18 or older if supported (non-Liquid Glass path).
  2. Check: first and last list rows clear both bars; no extra gap under the status bar; rotation and iPad split view keep correct insets (safeAreaChanged).
  3. Tap every tab, deep link into a nested route, go back with the native back button and (Android) the system back gesture: selected tab and title must match the route each time.
  4. Open and close each modal/sheet: bars hide and come back with the same tabs and selection.
  5. Run a push and back transition rapidly; the page must never stay blank.
  6. Inspect variables in Safari Web Inspector / Chrome DevTools: getComputedStyle(document.documentElement).getPropertyValue('--cap-native-navigation-top').
  7. await NativeNavigation.getPluginVersion() confirms the native side is installed (returns 'web' in a browser).

Resources

Files (capgo-skills)
  • references
    • api.md 11.1 KB
      Loading…
    • options.md 13.3 KB
      Loading…
    • platform-behavior.md 9.5 KB
      Loading…
  • metadata.json 1.7 KB
    Loading…
  • SKILL.md 14.4 KB
    ---
    name: capgo-native-navigation
    description: Adds truly native navbars and tab bars to a Capacitor app with @capgo/capacitor-native-navigation (Capacitor 9, plugin v9). iOS uses UINavigationBar / UITabBarController with system Liquid Glass on iOS 26+, sidebar placement on iOS 18+ and the iPhone Duo rail; Android uses an AppCompat Toolbar and a native tab surface. Covers configure/setNavbar/setTabbar, router sync through tabSelect, navbarBack, navbarItemTap, navbarSearch, navbarSegmentSelect events, --cap-native-navigation-* CSS inset variables, safeAreaChanged, WebView snapshot transitions (push, back, root, tab, zoom), large titles, search, segment rows, scroll hide, pull-to-refresh, badges, icons, overlays and the web fallback. Use when an app wants native chrome instead of HTML headers/tab bars or when this plugin misbehaves. Do not use for generic safe-area CSS (safe-area-handling), web page transitions without native bars (capgo-transitions), sheets (capgo-sheets), or Ionic tabs (ionic-design).
    ---
    
    # Capgo Native Navigation
    
    Native navbar, tab bar, safe-area insets and WebView snapshot transitions for Capacitor. The web router keeps route state and page rendering in one full-screen WebView. The plugin draws platform bars above it, reports user intent as events, and tells the page how much space the bars take.
    
    ## When to Use
    
    TRIGGER when:
    - The app wants real native tab bars / navbars (iOS 26 Liquid Glass, Android Material) instead of HTML `<header>` / `<nav>` bars
    - The user mentions `@capgo/capacitor-native-navigation`, `NativeNavigation.setTabbar`, `setNavbar`, `tabSelect`, `navbarBack`, or `--cap-native-navigation-*`
    - Native large titles, a native search field under the title, native segment rows, native pull-to-refresh, tab badges, or the iPhone Duo vertical rail are wanted
    - Content sits under the native bars, is padded twice, or the selected tab drifts from the route
    
    Do not use:
    - Generic notch / home indicator / `env(safe-area-inset-*)` CSS without native bars: `safe-area-handling`
    - Animated page stacks in the WebView without native bars: `capgo-transitions`
    - Bottom sheets / modal sheets: `capgo-sheets`
    - `ion-tabs`, `ion-header`, Ionic theming: `ionic-design`
    - Tap highlight, overscroll, input zoom polish: `capacitor-native-feel`
    
    Recommend this plugin when the app is a tab/stack app that should look and feel native, especially on iOS 26+ where HTML cannot reproduce the system Liquid Glass bar, scroll-edge effect, tab drag-to-select and sidebar placement.
    
    ## Requirements
    
    | Item | Value |
    |------|-------|
    | Plugin / Capacitor | plugin v9.x for Capacitor 9 (peer `@capacitor/core` ^9); plugin v8.x for Capacitor 8 (maintained on demand). The JS API of v9 equals v8. |
    | iOS | 16.0+ deployment target. System Liquid Glass bars need iOS 26+. `style.placement: 'auto' \| 'sidebar'` needs iOS 18+. Duo rail options need iOS 27.1+. |
    | Android | minSdk 26, compileSdk 37. Translucent `liquidGlass` tint on Android 12+ (no live blur); Android 11 and older draw solid bars. |
    | Web | No native bars. Same calls update CSS variables and emit events (dev preview). |
    
    ## Install
    
    ```bash
    npm install @capgo/capacitor-native-navigation
    npx cap sync
    ```
    
    No `capacitor.config` keys and no native project edits. Keep `viewport-fit=cover` in the `index.html` viewport meta so the WebView spans under the bars.
    
    ## Quick Start
    
    ```typescript
    import { NativeNavigation } from '@capgo/capacitor-native-navigation';
    
    await NativeNavigation.configure({ contentInsetMode: 'css', animationDuration: 360 });
    
    const tabs = [
      { id: 'home', title: 'Home', icon: { ios: { sfSymbol: 'house' }, android: { resource: 'ic_home' } },
        selectedIcon: { ios: { sfSymbol: 'house.fill' } } },
      { id: 'settings', title: 'Settings', icon: { svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/></svg>' } },
    ];
    
    // Keep the last rendered state; every call must send the full state (see Core concepts).
    let tabbar = { tabs, selectedId: 'home', labelVisibilityMode: 'labeled' as const };
    
    await NativeNavigation.setNavbar({ title: 'Home', large: true, backButton: { visible: false } });
    await NativeNavigation.setTabbar(tabbar);
    
    // Events only navigate. The router hook below renders the bars.
    await NativeNavigation.addListener('tabSelect', ({ id }) => router.push(`/${id}`));
    await NativeNavigation.addListener('navbarBack', () => router.back());
    
    // Example uses a Vue Router style hook; use your router's equivalent.
    router.afterEach(async (to) => {
      const tabId = to.path.split('/')[1];
      const isRoot = tabs.some((t) => `/${t.id}` === to.path);
      if (tabs.some((t) => t.id === tabId) && tabbar.selectedId !== tabId) {
        tabbar = { ...tabbar, selectedId: tabId };
        await NativeNavigation.setTabbar(tabbar);
      }
      await NativeNavigation.setNavbar({
        title: to.meta.title,
        large: isRoot,
        backButton: { visible: !isRoot, title: 'Back' },
        resetScrollCollapsed: true,
      });
    });
    ```
    
    ```css
    .page {
      min-height: 100dvh;
      padding-top: var(--cap-native-navigation-top);
      padding-bottom: var(--cap-native-navigation-bottom);
      padding-left: var(--cap-native-navigation-left);
      padding-right: var(--cap-native-navigation-right);
    }
    ```
    
    Delete the HTML header and tab bar. Native chrome owns those surfaces.
    
    ## Core Concepts
    
    - **Router owns state, plugin owns chrome.** Events (`tabSelect`, `navbarBack`, `navbarItemTap`, ...) are intents. The plugin never changes routes. Navigate in the handler, then render the bars from route state.
    - **Each `setNavbar` / `setTabbar` call is the full state on iOS and Android.** Omitted fields reset: omitting `search` removes the field, `setTabbar({ hidden: false })` without `tabs` clears the bar, `segments` re-apply `selectedId` every call. Keep one options object per bar and spread it. The web fallback merges instead, so a bug can hide on web.
    - **Insets include system areas.** `--cap-native-navigation-top` = status bar + navbar (+ search/segment rows) when the navbar is visible, else `0`. `--cap-native-navigation-bottom` = tab bar + home indicator / gesture bar when the tab bar is visible, else `0`. Left/right carry a sidebar or Duo rail.
    - **iOS 26+ system tab bar hosts the WebView.** The WebView ends above the bar, so `--cap-native-tabbar-height` is `0` and `--cap-native-system-tabbar-height` holds the nominal height. Do not add the bar height again.
    - **Overlays render under the bars.** Web modals, sheets, `<dialog>`, popovers live inside the WebView, so hide the bars that the overlay meets while it is open.
    - **Transitions are snapshots.** `beginTransition` covers the WebView with a snapshot and hides the live WebView; change the route; `finishTransition` animates to the live page. Default duration 350ms.
    
    ## API Summary
    
    | Method | Purpose |
    |--------|---------|
    | `configure(opts?)` | Enable/disable chrome, `contentInsetMode`, default `animationDuration`, shared `colors` / `glass`, Duo `verticalBarBehavior`. Returns `{ insets }`. |
    | `setNavbar(opts)` | Title, subtitle, large title, back button, left/right items, search, segment rows, colors, glass, edge blur, scroll hide. Returns `{ insets }`. |
    | `setTabbar(opts)` | Tabs, selection, labels, badges, colors, glass, shape (`floating` / `curve`), alignment, placement, minimize on scroll, haptics. Returns `{ insets }`. |
    | `reportNavbarScroll({ offsetY, deltaY })` | Feed scroll from a custom scroll root. |
    | `setPullToRefresh({ enabled, tintColor?, backgroundColor? })` / `endPullToRefresh()` | Native pull-to-refresh (no-op on web). |
    | `beginTransition(opts?)` / `finishTransition(opts?)` | Snapshot transitions: `forward`, `back`, `root`, `tab`, `zoom`, `none`. |
    | `beginZoomTransition(el, opts?)` / `finishZoomTransition(el?, opts?)` | Helpers that measure a DOM element for `zoom`. |
    | `getPluginVersion()` | Native version marker (`'web'` on web). |
    | `defineNativeNavigationElements()` | Registers `<cap-native-navigation-provider>`, `<cap-native-navbar>`, `<cap-native-tabbar>`. |
    
    Events: `navbarBack`, `navbarItemTap`, `navbarSearch`, `navbarSegmentSelect`, `tabSelect`, `safeAreaChanged`, `verticalBarChanged`, `hingeChanged`, `transitionStart`, `transitionEnd`, `pullToRefresh`.
    
    ## References
    
    Only load a reference when its topic is in play.
    
    | File | Load when |
    |------|-----------|
    | [references/api.md](references/api.md) | Calling any method, listening to any event, using zoom helpers or web components |
    | [references/options.md](references/options.md) | Building navbar / tabbar / configure / icon / color / glass / transition options, or looking up a type alias |
    | [references/platform-behavior.md](references/platform-behavior.md) | Insets and CSS variables, iOS vs Android vs web differences, Liquid Glass, overlays, scroll behavior, iPhone Duo, debugging layout |
    
    ## Patterns
    
    ### Navbar buttons and back
    
    ```typescript
    await NativeNavigation.setNavbar({
      title: 'Inbox',
      backButton: { visible: true, title: 'Mailboxes' },
      rightItems: [{ id: 'compose', accessibilityLabel: 'Compose', icon: { ios: { sfSymbol: 'square.and.pencil' } } }],
    });
    NativeNavigation.addListener('navbarItemTap', ({ id, placement }) => {
      if (id === 'compose') router.push('/compose');
    });
    ```
    
    ### Push with a native snapshot transition
    
    ```typescript
    const t = await NativeNavigation.beginTransition({ direction: 'forward' });
    try {
      await router.push('/detail');
      await NativeNavigation.setNavbar({ title: 'Detail', backButton: { visible: true, title: 'Back' } });
    } finally {
      await NativeNavigation.finishTransition({ id: t.id, direction: 'forward' });
    }
    ```
    
    With `@capgo/capacitor-transitions` animating the WebView page stack, skip `beginTransition` for that navigation: pick one animation layer per navigation. Use the plugin's zoom helpers only for shared-element routes.
    
    ### Overlay open/close
    
    Hide bars before an overlay presents and restore the same options after it dismisses. Count stacked overlays.
    
    ```typescript
    await NativeNavigation.setNavbar({ ...navbar, hidden: true });
    await NativeNavigation.setTabbar({ ...tabbar, hidden: true, animated: true });
    // after dismiss
    await NativeNavigation.setNavbar({ ...navbar, hidden: false });
    await NativeNavigation.setTabbar({ ...tabbar, hidden: false, animated: true });
    ```
    
    ### Pull to refresh
    
    ```typescript
    await NativeNavigation.setPullToRefresh({ enabled: true });
    NativeNavigation.addListener('pullToRefresh', async () => {
      try {
        await reloadData();
      } catch (err) {
        showError(err);                       // e.g. offline; tell the user
      } finally {
        await NativeNavigation.endPullToRefresh(); // spinner stays until this runs
      }
    });
    ```
    
    Search, segment rows, scroll-driven chrome, tab styling and Duo patterns: [references/api.md](references/api.md) and [references/platform-behavior.md](references/platform-behavior.md).
    
    ## Traps
    
    1. **Double safe-area padding.** The `--cap-native-navigation-*` values already include the status bar and home indicator. Never write `calc(env(safe-area-inset-top) + var(--cap-native-navigation-top))`. When a bar can be hidden, use `max(env(safe-area-inset-top), var(--cap-native-navigation-top))`. Remove `padding: env(safe-area-inset-*)` on a wrapper that also gets the plugin variables. On iOS 26+ do not add `--cap-native-system-tabbar-height` to bottom padding: the hosted WebView already ends above the bar.
    2. **Router and tab selection drift.** Native taps move the selection immediately; the next `setTabbar` re-applies `selectedId`. Update `selectedId` on every route change (deep links, `router.back()`, programmatic navigation), not only in `tabSelect`. Same for `segments[].selectedId` and `search.text`.
    3. **Partial updates wipe state.** Sending `{ hidden: true }` alone clears tabs / title on native. Always spread the last full options.
    4. **Android hardware back is not `navbarBack`.** `navbarBack` fires only when the user taps the native back control (iOS and Android). Handle the Android system back button / gesture yourself, for example with `@capacitor/app` `App.addListener('backButton', ...)`, and route both to the same back function.
    5. **Transition left open.** After `beginTransition`, the live WebView is nearly transparent until `finishTransition`. Always finish in `finally`, and never stack a web page transition on the same navigation.
    6. **Overlays under the bars.** `ion-modal`, `<dialog>` and menus are inside the WebView; hide the bars they cover, then restore with full options. `animated: false` on the iOS 26 system tab bar tears the tab controller down; prefer `animated: true` for overlay toggles.
    7. **Icons must be serializable.** No framework components. Use `svg` (path, line, polyline, polygon, circle, rect only), SF Symbols, asset-catalog images, or Android drawable names. Set `accessibilityLabel` on icon-only buttons.
    8. **Colors on iOS 26+.** `colors.background` is ignored and `inactiveTint` needs `experimentalBakedTintColors` (which can shift badges/icon size). Let Liquid Glass be.
    9. **Android blur.** `liquidGlass` on Android is a translucent tint only. Put a CSS `backdrop-filter` element under the bar (or use `edgeBlur`) when blur is wanted.
    10. **Scroll roots.** Scroll hide, tab minimize and pull-to-refresh only see `window`, `#app` and `[data-cap-native-navigation-scroll]`. Mark the real scroll container or call `reportNavbarScroll()` for others, never both.
    11. **Web lies.** Web merges options, keeps a previous `search`, and does nothing for pull-to-refresh. Verify on devices.
    
    ## Verify on Device
    
    1. `npx cap sync` then run on an iOS 26+ simulator/device and an Android 12+ device; also iOS 18 or older if supported (non-Liquid Glass path).
    2. Check: first and last list rows clear both bars; no extra gap under the status bar; rotation and iPad split view keep correct insets (`safeAreaChanged`).
    3. Tap every tab, deep link into a nested route, go back with the native back button and (Android) the system back gesture: selected tab and title must match the route each time.
    4. Open and close each modal/sheet: bars hide and come back with the same tabs and selection.
    5. Run a push and back transition rapidly; the page must never stay blank.
    6. Inspect variables in Safari Web Inspector / Chrome DevTools: `getComputedStyle(document.documentElement).getPropertyValue('--cap-native-navigation-top')`.
    7. `await NativeNavigation.getPluginVersion()` confirms the native side is installed (returns `'web'` in a browser).
    
    ## Resources
    
    - Docs: https://capgo.app/docs/plugins/native-navigation/
    - Source and example app: https://github.com/Cap-go/capacitor-native-navigation (`example-app/`)
    - npm: https://www.npmjs.com/package/@capgo/capacitor-native-navigation
    

Comments

Sign in to join the conversation.

No comments yet. Start the conversation.

Reviews (0)

No reviews yet.