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/native-navigation`
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/native-navigation/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 the package
Terminal window bun add @capgo/native-navigation -
Sync native projects
Terminal window bunx cap sync -
Configure native chrome
import { NativeNavigation } from '@capgo/native-navigation';await NativeNavigation.configure({contentInsetMode: 'css',animationDuration: 360,colors: {tint: '#0f172a',inactiveTint: '#64748b',},}); -
Render the native navbar
await NativeNavigation.setNavbar({title: 'Home',subtitle: 'Native chrome',transparent: true,backButton: { visible: false },rightItems: [{id: 'compose',title: 'Compose',icon: {svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9"/><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg>',},},],}); -
Render the native tabbar
await NativeNavigation.setTabbar({selectedId: 'home',labels: true,icons: true,tabs: [{id: 'home',title: 'Home',icon: {svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 10.5 12 3l9 7.5"/><path d="M5 10v10h14V10"/></svg>',},},{id: 'settings',title: 'Settings',badge: '2',icon: {svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3"/></svg>',},},],}); -
Handle native intent events
await NativeNavigation.addListener('navbarBack', () => {router.back();});await NativeNavigation.addListener('navbarItemTap', ({ id }) => {if (id === 'compose') router.push('/compose');});await NativeNavigation.addListener('tabSelect', ({ id }) => {router.push(`/${id}`);});
Transition flow
Section titled “Transition flow”Native transitions are a transaction around your normal JavaScript route change:
const transition = await NativeNavigation.beginTransition({ direction: 'forward',});
router.push('/detail');await router.ready?.();
await NativeNavigation.setNavbar({ title: 'Detail', backButton: { visible: true, title: 'Back' },});
await NativeNavigation.finishTransition({ id: transition.id, direction: 'forward',});CSS insets
Section titled “CSS insets”With contentInsetMode: 'css', the plugin writes native bar dimensions to document.documentElement.
.page { padding-top: var(--cap-native-navigation-top); padding-bottom: var(--cap-native-navigation-bottom);}Available variables:
--cap-native-navigation-top--cap-native-navigation-right--cap-native-navigation-bottom--cap-native-navigation-left--cap-native-navbar-height--cap-native-tabbar-height
Icon descriptors
Section titled “Icon descriptors”Icons must be serializable because native UI renders them. You can use cross-platform SVG, platform-specific SVG, SF Symbols, bundled iOS images, Android drawable resources, or bundled Android images.
const icon = { svg: '<svg viewBox="0 0 24 24"><path d="M3 10.5 12 3l9 7.5"/></svg>', width: 24, height: 24, template: true, src: 'fallback_asset_name', ios: { svg: '<svg viewBox="0 0 24 24"><path d="M3 10.5 12 3l9 7.5"/></svg>', sfSymbol: 'house.fill', image: 'BundledAssetName', }, android: { svg: '<svg viewBox="0 0 24 24"><path d="M3 10.5 12 3l9 7.5"/></svg>', resource: 'ic_menu_view', image: 'bundled_drawable_name', },};Inline SVG supports the icon-focused subset used by common icon sets such as Lucide and Feather: path, line, polyline, polygon, circle, and rect. SVG icons are rendered as template images by default, so native tint colors can recolor them.
Optional web components
Section titled “Optional web components”The package can register custom elements for framework-agnostic declarative setup:
import { defineNativeNavigationElements } from '@capgo/native-navigation';
defineNativeNavigationElements();<cap-native-navigation-provider enabled="true" content-inset-mode="css"></cap-native-navigation-provider>
<cap-native-navbar title="Home" transparent right-items='[{"id":"compose","title":"Compose","icon":{"svg":"<svg viewBox=\"0 0 24 24\"><path d=\"M12 20h9\"/></svg>"}}]'></cap-native-navbar>
<cap-native-tabbar selected-id="home" tabs='[{"id":"home","title":"Home","icon":{"ios":{"sfSymbol":"house.fill"}}}]'></cap-native-tabbar>Platform notes
Section titled “Platform notes”- iOS renders
UINavigationBarandUITabBar; iOS 26+ uses the system Liquid Glass bar behavior. - Android renders an AppCompat toolbar and Material bottom navigation.
- Web fallback does not draw native bars. It mirrors events and inset variables for browser development.
- The plugin keeps one full-screen Capacitor WebView. Native owns the frame, bars, safe-area reporting, and transition shell.