@capgo/capacitor-native-navigation 8.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CapgoNativeNavigation.podspec +17 -0
  2. package/LICENSE +373 -0
  3. package/Package.swift +28 -0
  4. package/README.md +858 -0
  5. package/android/build.gradle +61 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/java/app/capgo/nativenavigation/NativeNavigation.java +8 -0
  8. package/android/src/main/java/app/capgo/nativenavigation/NativeNavigationPlugin.java +1322 -0
  9. package/android/src/main/res/.gitkeep +0 -0
  10. package/dist/docs.json +1369 -0
  11. package/dist/esm/components.d.ts +1 -0
  12. package/dist/esm/components.js +159 -0
  13. package/dist/esm/components.js.map +1 -0
  14. package/dist/esm/definitions.d.ts +470 -0
  15. package/dist/esm/definitions.js +2 -0
  16. package/dist/esm/definitions.js.map +1 -0
  17. package/dist/esm/index.d.ts +19 -0
  18. package/dist/esm/index.js +40 -0
  19. package/dist/esm/index.js.map +1 -0
  20. package/dist/esm/plugin.d.ts +2 -0
  21. package/dist/esm/plugin.js +2 -0
  22. package/dist/esm/plugin.js.map +1 -0
  23. package/dist/esm/web.d.ts +17 -0
  24. package/dist/esm/web.js +90 -0
  25. package/dist/esm/web.js.map +1 -0
  26. package/dist/plugin.cjs.js +310 -0
  27. package/dist/plugin.cjs.js.map +1 -0
  28. package/dist/plugin.js +313 -0
  29. package/dist/plugin.js.map +1 -0
  30. package/docs/demo-navigation.webp +0 -0
  31. package/docs/demo-options.webp +0 -0
  32. package/docs/demo-svg-icons.webp +0 -0
  33. package/ios/Sources/NativeNavigationPlugin/NativeNavigation.swift +7 -0
  34. package/ios/Sources/NativeNavigationPlugin/NativeNavigationPlugin.swift +1580 -0
  35. package/ios/Tests/NativeNavigationPluginTests/NativeNavigationTests.swift +19 -0
  36. package/package.json +91 -0
package/README.md ADDED
@@ -0,0 +1,858 @@
1
+ # @capgo/capacitor-native-navigation
2
+ <a href="https://capgo.app/"><img src="https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png" alt="Capgo - Instant updates for capacitor" /></a>
3
+
4
+ <div align="center">
5
+ <h2><a href="https://capgo.app/?ref=plugin_native_navigation">Get instant updates for your app with Capgo</a></h2>
6
+ <h2><a href="https://capgo.app/consulting/?ref=plugin_native_navigation">Missing a feature? We can build the plugin for you</a></h2>
7
+ </div>
8
+
9
+ Native navigation chrome for Capacitor apps. Render a native navbar, native tabbar, and native transition shell over a single full-screen WebView while your framework keeps owning routes and content.
10
+
11
+ ## Demo
12
+
13
+ ### Native navigation tap flow
14
+
15
+ <img src="./docs/demo-navigation.webp" alt="Animated native navigation tap flow showing tab selection, push transition, and native back" width="320" />
16
+
17
+ ### SVG icon descriptors
18
+
19
+ <img src="./docs/demo-svg-icons.webp" alt="Animated native SVG icon demo showing inline SVG icons, native tint, labels, and tab selection" width="320" />
20
+
21
+ ### Native styling and zoom options
22
+
23
+ <img src="./docs/demo-options.webp" alt="Animated native navigation options demo showing dynamic colors, selected labels, custom indicators, badges, system Liquid Glass, and zoom transitions" width="320" />
24
+
25
+ ## What It Does
26
+
27
+ - Renders native top navigation and bottom tab chrome from JavaScript state.
28
+ - Emits native intent events such as `navbarBack`, `navbarItemTap`, and `tabSelect`.
29
+ - Captures WebView snapshots for native-feeling push, back, root, tab, and zoom transition shells.
30
+ - Supports native tab styling controls such as Material You dynamic colors, label visibility, indicators, ripples, badges, and selected icons.
31
+ - Writes CSS variables so web content can scroll behind native bars without being hidden.
32
+ - Works with React, Vue, Angular, Svelte, Solid, vanilla JS, and any router that can call imperative methods.
33
+
34
+ ## What It Does Not Do
35
+
36
+ - It does not create one native WebView per route.
37
+ - It does not render React/Vue/Svelte icon nodes natively. Icons must be serializable descriptors such as SVG strings, SF Symbols, or native resource names.
38
+ - It does not replace your router. JS still owns route state and web content rendering.
39
+
40
+ ## Compatibility
41
+
42
+ | Plugin version | Capacitor compatibility | Maintained |
43
+ | -------------- | ----------------------- | ---------- |
44
+ | v8.\*.\* | v8.\*.\* | Yes |
45
+ | v7.\*.\* | v7.\*.\* | On demand |
46
+ | v6.\*.\* | v6.\*.\* | On demand |
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ bun add @capgo/capacitor-native-navigation
52
+ bunx cap sync
53
+ ```
54
+
55
+ ## Minimal Usage
56
+
57
+ ```typescript
58
+ import { NativeNavigation } from '@capgo/capacitor-native-navigation';
59
+
60
+ await NativeNavigation.configure({
61
+ contentInsetMode: 'css',
62
+ animationDuration: 360,
63
+ });
64
+
65
+ await NativeNavigation.setNavbar({
66
+ title: 'Home',
67
+ subtitle: 'Native chrome',
68
+ transparent: true,
69
+ backButton: { visible: false },
70
+ rightItems: [
71
+ {
72
+ id: 'compose',
73
+ title: 'Compose',
74
+ icon: {
75
+ 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>',
76
+ },
77
+ },
78
+ ],
79
+ });
80
+
81
+ await NativeNavigation.setTabbar({
82
+ selectedId: 'home',
83
+ labelVisibilityMode: 'labeled',
84
+ icons: true,
85
+ colors: {
86
+ dynamic: true,
87
+ },
88
+ tabs: [
89
+ {
90
+ id: 'home',
91
+ title: 'Home',
92
+ icon: {
93
+ 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>',
94
+ },
95
+ },
96
+ {
97
+ id: 'settings',
98
+ title: 'Settings',
99
+ icon: {
100
+ 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>',
101
+ },
102
+ },
103
+ ],
104
+ });
105
+
106
+ NativeNavigation.addListener('tabSelect', ({ id }) => {
107
+ router.navigate(id);
108
+ });
109
+ ```
110
+
111
+ ## Native Tab Styling
112
+
113
+ ```typescript
114
+ await NativeNavigation.setTabbar({
115
+ selectedId: 'home',
116
+ labelVisibilityMode: 'selected',
117
+ indicatorColor: '#0A84FF',
118
+ rippleColor: '#330A84FF',
119
+ badgeBackgroundColor: '#FF3B30',
120
+ badgeTextColor: '#FFFFFF',
121
+ colors: {
122
+ dynamic: true,
123
+ tint: '#0A84FF',
124
+ inactiveTint: '#8E8E93',
125
+ },
126
+ tabs: [
127
+ {
128
+ id: 'home',
129
+ title: 'Home',
130
+ icon: { ios: { sfSymbol: 'house' }, android: { resource: 'ic_home' } },
131
+ selectedIcon: { ios: { sfSymbol: 'house.fill' }, android: { resource: 'ic_home_filled' } },
132
+ },
133
+ ],
134
+ });
135
+ ```
136
+
137
+ ## Transition Flow
138
+
139
+ ```typescript
140
+ const transition = await NativeNavigation.beginTransition({ direction: 'forward' });
141
+
142
+ router.navigate('/detail');
143
+ await router.ready?.();
144
+
145
+ await NativeNavigation.setNavbar({
146
+ title: 'Detail',
147
+ backButton: { visible: true, title: 'Back' },
148
+ });
149
+
150
+ await NativeNavigation.finishTransition({
151
+ id: transition.id,
152
+ direction: 'forward',
153
+ });
154
+ ```
155
+
156
+ ## Use With @capgo/capacitor-transitions
157
+
158
+ Use `@capgo/capacitor-native-navigation` for the native navbar, tabbar, safe-area insets, and native intent events. Use `@capgo/capacitor-transitions` for the WebView page stack underneath that native chrome.
159
+
160
+ ```bash
161
+ npm install @capgo/capacitor-native-navigation @capgo/capacitor-transitions
162
+ npx cap sync
163
+ ```
164
+
165
+ Initialize both packages once when the app starts:
166
+
167
+ ```typescript
168
+ import { NativeNavigation } from '@capgo/capacitor-native-navigation';
169
+ import '@capgo/capacitor-transitions';
170
+ import { initTransitions, setupRouterOutlet, setDirection } from '@capgo/capacitor-transitions/react';
171
+
172
+ initTransitions({ platform: 'auto' });
173
+
174
+ const outlet = document.querySelector('cap-router-outlet');
175
+ if (outlet) {
176
+ setupRouterOutlet(outlet, { platform: 'auto', swipeGesture: 'auto' });
177
+ }
178
+
179
+ await NativeNavigation.configure({
180
+ contentInsetMode: 'css',
181
+ });
182
+ ```
183
+
184
+ Keep the transition outlet focused on pages. Do not render a web header or footer when native chrome owns those surfaces:
185
+
186
+ ```html
187
+ <cap-router-outlet platform="auto" swipe-gesture="auto">
188
+ <cap-page>
189
+ <cap-content slot="content" fullscreen>
190
+ <main class="page">Inbox content</main>
191
+ </cap-content>
192
+ </cap-page>
193
+ </cap-router-outlet>
194
+ ```
195
+
196
+ ```css
197
+ .page {
198
+ min-height: 100dvh;
199
+ padding-top: var(--cap-native-navigation-top);
200
+ padding-bottom: var(--cap-native-navigation-bottom);
201
+ }
202
+ ```
203
+
204
+ Drive both packages from the same router actions:
205
+
206
+ ```typescript
207
+ async function openMessage(id: string) {
208
+ setDirection('forward');
209
+ await router.push(`/messages/${id}`);
210
+ await NativeNavigation.setNavbar({
211
+ title: 'Message',
212
+ backButton: { visible: true, title: 'Inbox' },
213
+ });
214
+ }
215
+
216
+ await NativeNavigation.addListener('navbarBack', () => {
217
+ setDirection('back');
218
+ router.back();
219
+ });
220
+
221
+ await NativeNavigation.addListener('tabSelect', ({ id }) => {
222
+ setDirection('root');
223
+ router.push(`/${id}`);
224
+ });
225
+ ```
226
+
227
+ Pick one animation layer per navigation. For normal route pushes, let `@capgo/capacitor-transitions` animate the WebView pages and update native bars with `setNavbar` / `setTabbar`. For shared-element or zoom routes, use `beginZoomTransition` / `finishZoomTransition` from this plugin and skip the web page transition for that navigation.
228
+
229
+ ## Zoom Transition
230
+
231
+ ```typescript
232
+ import { beginZoomTransition, finishZoomTransition } from '@capgo/capacitor-native-navigation';
233
+
234
+ const card = document.querySelector('[data-photo-card]');
235
+ if (card) {
236
+ const transition = await beginZoomTransition(card, { cornerRadius: 18 });
237
+
238
+ router.navigate('/photo/42');
239
+ await router.ready?.();
240
+
241
+ await finishZoomTransition(undefined, {
242
+ id: transition.id,
243
+ cornerRadius: 18,
244
+ });
245
+ }
246
+ ```
247
+
248
+ ## CSS Insets
249
+
250
+ With `contentInsetMode: 'css'`, the plugin updates these variables on `document.documentElement`:
251
+
252
+ ```css
253
+ .app-scroll {
254
+ height: 100dvh;
255
+ overflow: auto;
256
+ padding-top: calc(var(--cap-native-navigation-top) + 24px);
257
+ scroll-padding-bottom: calc(var(--cap-native-navigation-bottom) + 24px);
258
+ }
259
+
260
+ .page {
261
+ min-height: 100dvh;
262
+ padding-bottom: calc(var(--cap-native-navigation-bottom) + 24px);
263
+ }
264
+ ```
265
+
266
+ Available variables:
267
+
268
+ - `--cap-native-navigation-top`
269
+ - `--cap-native-navigation-right`
270
+ - `--cap-native-navigation-bottom`
271
+ - `--cap-native-navigation-left`
272
+ - `--cap-native-navbar-height`
273
+ - `--cap-native-tabbar-height`
274
+
275
+ ## Web Components
276
+
277
+ The package can register optional custom elements for framework-agnostic declarative setup:
278
+
279
+ ```typescript
280
+ import { defineNativeNavigationElements } from '@capgo/capacitor-native-navigation';
281
+
282
+ defineNativeNavigationElements();
283
+ ```
284
+
285
+ ```html
286
+ <cap-native-navigation-provider enabled="true" content-inset-mode="css"></cap-native-navigation-provider>
287
+
288
+ <cap-native-navbar
289
+ title="Home"
290
+ subtitle="Native chrome"
291
+ transparent
292
+ right-items='[{"id":"compose","title":"Compose","icon":{"ios":{"sfSymbol":"square.and.pencil"}}}]'
293
+ ></cap-native-navbar>
294
+
295
+ <cap-native-tabbar
296
+ selected-id="home"
297
+ tabs='[{"id":"home","title":"Home","icon":{"ios":{"sfSymbol":"house.fill"}}}]'
298
+ ></cap-native-tabbar>
299
+ ```
300
+
301
+ ## Icon Descriptors
302
+
303
+ ```typescript
304
+ const icon = {
305
+ svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 10.5 12 3l9 7.5"/></svg>',
306
+ width: 24,
307
+ height: 24,
308
+ template: true,
309
+ src: 'fallback_asset_name',
310
+ ios: {
311
+ svg: '<svg viewBox="0 0 24 24"><path d="M3 10.5 12 3l9 7.5"/></svg>',
312
+ sfSymbol: 'house.fill',
313
+ image: 'BundledAssetName',
314
+ },
315
+ android: {
316
+ svg: '<svg viewBox="0 0 24 24"><path d="M3 10.5 12 3l9 7.5"/></svg>',
317
+ resource: 'ic_menu_view',
318
+ image: 'bundled_drawable_name',
319
+ },
320
+ };
321
+ ```
322
+
323
+ Inline SVG supports the icon-focused subset used by common sets such as Lucide and Feather: `path`, `line`, `polyline`, `polygon`, `circle`, and `rect`. The SVG is rendered as a template image by default, so native tint colors can recolor it without bundling a platform asset.
324
+
325
+ ## Platform Notes
326
+
327
+ - iOS uses UIKit `UINavigationBar` and `UITabBar`. iOS 26+ leaves bar backgrounds to Apple's system Liquid Glass; earlier versions use native translucent/material fallback styling.
328
+ - Android uses an AppCompat `Toolbar` and a floating native tab capsule with edge-to-edge placement.
329
+ - Web fallback does not draw native bars; it mirrors inset variables and events for development.
330
+
331
+ ## Example App
332
+
333
+ The `example-app/` folder is a vanilla JS Capacitor demo linked with `file:..`.
334
+
335
+ ```bash
336
+ cd example-app
337
+ bun install
338
+ bun run build
339
+ bunx cap add ios
340
+ bunx cap add android
341
+ bunx cap sync
342
+ ```
343
+
344
+ ## API
345
+
346
+ <docgen-index>
347
+
348
+ * [`configure(...)`](#configure)
349
+ * [`setNavbar(...)`](#setnavbar)
350
+ * [`setTabbar(...)`](#settabbar)
351
+ * [`beginTransition(...)`](#begintransition)
352
+ * [`finishTransition(...)`](#finishtransition)
353
+ * [`getPluginVersion()`](#getpluginversion)
354
+ * [`addListener('navbarBack', ...)`](#addlistenernavbarback-)
355
+ * [`addListener('navbarItemTap', ...)`](#addlistenernavbaritemtap-)
356
+ * [`addListener('tabSelect', ...)`](#addlistenertabselect-)
357
+ * [`addListener('safeAreaChanged', ...)`](#addlistenersafeareachanged-)
358
+ * [`addListener('transitionStart', ...)`](#addlistenertransitionstart-)
359
+ * [`addListener('transitionEnd', ...)`](#addlistenertransitionend-)
360
+ * [Interfaces](#interfaces)
361
+ * [Type Aliases](#type-aliases)
362
+
363
+ </docgen-index>
364
+
365
+ <docgen-api>
366
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
367
+
368
+ Framework-agnostic native navigation chrome API.
369
+
370
+ ### configure(...)
371
+
372
+ ```typescript
373
+ configure(options?: NativeNavigationConfigureOptions | undefined) => Promise<NativeNavigationInsetsResult>
374
+ ```
375
+
376
+ Configure the native chrome host and content inset behavior.
377
+
378
+ | Param | Type |
379
+ | ------------- | --------------------------------------------------------------------------------------------- |
380
+ | **`options`** | <code><a href="#nativenavigationconfigureoptions">NativeNavigationConfigureOptions</a></code> |
381
+
382
+ **Returns:** <code>Promise&lt;<a href="#nativenavigationinsetsresult">NativeNavigationInsetsResult</a>&gt;</code>
383
+
384
+ --------------------
385
+
386
+
387
+ ### setNavbar(...)
388
+
389
+ ```typescript
390
+ setNavbar(options: NativeNavigationNavbarOptions) => Promise<NativeNavigationInsetsResult>
391
+ ```
392
+
393
+ Render or update the native navbar.
394
+
395
+ | Param | Type |
396
+ | ------------- | --------------------------------------------------------------------------------------- |
397
+ | **`options`** | <code><a href="#nativenavigationnavbaroptions">NativeNavigationNavbarOptions</a></code> |
398
+
399
+ **Returns:** <code>Promise&lt;<a href="#nativenavigationinsetsresult">NativeNavigationInsetsResult</a>&gt;</code>
400
+
401
+ --------------------
402
+
403
+
404
+ ### setTabbar(...)
405
+
406
+ ```typescript
407
+ setTabbar(options: NativeNavigationTabbarOptions) => Promise<NativeNavigationInsetsResult>
408
+ ```
409
+
410
+ Render or update the native tabbar.
411
+
412
+ | Param | Type |
413
+ | ------------- | --------------------------------------------------------------------------------------- |
414
+ | **`options`** | <code><a href="#nativenavigationtabbaroptions">NativeNavigationTabbarOptions</a></code> |
415
+
416
+ **Returns:** <code>Promise&lt;<a href="#nativenavigationinsetsresult">NativeNavigationInsetsResult</a>&gt;</code>
417
+
418
+ --------------------
419
+
420
+
421
+ ### beginTransition(...)
422
+
423
+ ```typescript
424
+ beginTransition(options?: NativeNavigationBeginTransitionOptions | undefined) => Promise<NativeNavigationTransitionResult>
425
+ ```
426
+
427
+ Capture the current WebView and prepare a native transition.
428
+
429
+ | Param | Type |
430
+ | ------------- | --------------------------------------------------------------------------------------------------------- |
431
+ | **`options`** | <code><a href="#nativenavigationbegintransitionoptions">NativeNavigationBeginTransitionOptions</a></code> |
432
+
433
+ **Returns:** <code>Promise&lt;<a href="#nativenavigationtransitionresult">NativeNavigationTransitionResult</a>&gt;</code>
434
+
435
+ --------------------
436
+
437
+
438
+ ### finishTransition(...)
439
+
440
+ ```typescript
441
+ finishTransition(options?: NativeNavigationFinishTransitionOptions | undefined) => Promise<NativeNavigationTransitionResult>
442
+ ```
443
+
444
+ Animate from the captured WebView snapshot to the current live WebView.
445
+
446
+ | Param | Type |
447
+ | ------------- | ----------------------------------------------------------------------------------------------------------- |
448
+ | **`options`** | <code><a href="#nativenavigationfinishtransitionoptions">NativeNavigationFinishTransitionOptions</a></code> |
449
+
450
+ **Returns:** <code>Promise&lt;<a href="#nativenavigationtransitionresult">NativeNavigationTransitionResult</a>&gt;</code>
451
+
452
+ --------------------
453
+
454
+
455
+ ### getPluginVersion()
456
+
457
+ ```typescript
458
+ getPluginVersion() => Promise<PluginVersionResult>
459
+ ```
460
+
461
+ Returns the platform implementation version marker.
462
+
463
+ **Returns:** <code>Promise&lt;<a href="#pluginversionresult">PluginVersionResult</a>&gt;</code>
464
+
465
+ --------------------
466
+
467
+
468
+ ### addListener('navbarBack', ...)
469
+
470
+ ```typescript
471
+ addListener(eventName: 'navbarBack', listenerFunc: (event: NativeNavigationBackEvent) => void) => Promise<PluginListenerHandle>
472
+ ```
473
+
474
+ | Param | Type |
475
+ | ------------------ | --------------------------------------------------------------------------------------------------- |
476
+ | **`eventName`** | <code>'navbarBack'</code> |
477
+ | **`listenerFunc`** | <code>(event: <a href="#nativenavigationbackevent">NativeNavigationBackEvent</a>) =&gt; void</code> |
478
+
479
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
480
+
481
+ --------------------
482
+
483
+
484
+ ### addListener('navbarItemTap', ...)
485
+
486
+ ```typescript
487
+ addListener(eventName: 'navbarItemTap', listenerFunc: (event: NativeNavigationBarItemTapEvent) => void) => Promise<PluginListenerHandle>
488
+ ```
489
+
490
+ | Param | Type |
491
+ | ------------------ | --------------------------------------------------------------------------------------------------------------- |
492
+ | **`eventName`** | <code>'navbarItemTap'</code> |
493
+ | **`listenerFunc`** | <code>(event: <a href="#nativenavigationbaritemtapevent">NativeNavigationBarItemTapEvent</a>) =&gt; void</code> |
494
+
495
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
496
+
497
+ --------------------
498
+
499
+
500
+ ### addListener('tabSelect', ...)
501
+
502
+ ```typescript
503
+ addListener(eventName: 'tabSelect', listenerFunc: (event: NativeNavigationTabSelectEvent) => void) => Promise<PluginListenerHandle>
504
+ ```
505
+
506
+ | Param | Type |
507
+ | ------------------ | ------------------------------------------------------------------------------------------------------------- |
508
+ | **`eventName`** | <code>'tabSelect'</code> |
509
+ | **`listenerFunc`** | <code>(event: <a href="#nativenavigationtabselectevent">NativeNavigationTabSelectEvent</a>) =&gt; void</code> |
510
+
511
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
512
+
513
+ --------------------
514
+
515
+
516
+ ### addListener('safeAreaChanged', ...)
517
+
518
+ ```typescript
519
+ addListener(eventName: 'safeAreaChanged', listenerFunc: (event: NativeNavigationSafeAreaChangedEvent) => void) => Promise<PluginListenerHandle>
520
+ ```
521
+
522
+ | Param | Type |
523
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
524
+ | **`eventName`** | <code>'safeAreaChanged'</code> |
525
+ | **`listenerFunc`** | <code>(event: <a href="#nativenavigationsafeareachangedevent">NativeNavigationSafeAreaChangedEvent</a>) =&gt; void</code> |
526
+
527
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
528
+
529
+ --------------------
530
+
531
+
532
+ ### addListener('transitionStart', ...)
533
+
534
+ ```typescript
535
+ addListener(eventName: 'transitionStart', listenerFunc: (event: NativeNavigationTransitionEvent) => void) => Promise<PluginListenerHandle>
536
+ ```
537
+
538
+ | Param | Type |
539
+ | ------------------ | --------------------------------------------------------------------------------------------------------------- |
540
+ | **`eventName`** | <code>'transitionStart'</code> |
541
+ | **`listenerFunc`** | <code>(event: <a href="#nativenavigationtransitionevent">NativeNavigationTransitionEvent</a>) =&gt; void</code> |
542
+
543
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
544
+
545
+ --------------------
546
+
547
+
548
+ ### addListener('transitionEnd', ...)
549
+
550
+ ```typescript
551
+ addListener(eventName: 'transitionEnd', listenerFunc: (event: NativeNavigationTransitionEvent) => void) => Promise<PluginListenerHandle>
552
+ ```
553
+
554
+ | Param | Type |
555
+ | ------------------ | --------------------------------------------------------------------------------------------------------------- |
556
+ | **`eventName`** | <code>'transitionEnd'</code> |
557
+ | **`listenerFunc`** | <code>(event: <a href="#nativenavigationtransitionevent">NativeNavigationTransitionEvent</a>) =&gt; void</code> |
558
+
559
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
560
+
561
+ --------------------
562
+
563
+
564
+ ### Interfaces
565
+
566
+
567
+ #### NativeNavigationInsetsResult
568
+
569
+ Returned by methods that may change safe content bounds.
570
+
571
+ | Prop | Type |
572
+ | ------------ | ------------------------------------------------------------------------- |
573
+ | **`insets`** | <code><a href="#nativenavigationinsets">NativeNavigationInsets</a></code> |
574
+
575
+
576
+ #### NativeNavigationInsets
577
+
578
+ Insets exposed to web content.
579
+
580
+ | Prop | Type |
581
+ | ------------------ | ------------------- |
582
+ | **`top`** | <code>number</code> |
583
+ | **`right`** | <code>number</code> |
584
+ | **`bottom`** | <code>number</code> |
585
+ | **`left`** | <code>number</code> |
586
+ | **`navbarHeight`** | <code>number</code> |
587
+ | **`tabbarHeight`** | <code>number</code> |
588
+
589
+
590
+ #### NativeNavigationConfigureOptions
591
+
592
+ Global plugin configuration.
593
+
594
+ | Prop | Type | Description |
595
+ | ----------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
596
+ | **`enabled`** | <code>boolean</code> | Enables or disables the native chrome host. |
597
+ | **`platformStyle`** | <code><a href="#nativenavigationplatformstyle">NativeNavigationPlatformStyle</a></code> | Native style preference. `auto` uses the current platform. |
598
+ | **`contentInsetMode`** | <code><a href="#nativenavigationcontentinsetmode">NativeNavigationContentInsetMode</a></code> | When `css`, the plugin writes CSS variables on `document.documentElement`. |
599
+ | **`animationDuration`** | <code>number</code> | Default native transition duration in milliseconds. |
600
+ | **`colors`** | <code><a href="#nativenavigationcolors">NativeNavigationColors</a></code> | Shared color hints for native bars. |
601
+
602
+
603
+ #### NativeNavigationColors
604
+
605
+ Native bar colors. Use CSS-style hex strings (`#RRGGBB` or `#AARRGGBB`).
606
+
607
+ | Prop | Type | Description |
608
+ | --------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------- |
609
+ | **`dynamic`** | <code>boolean</code> | When `true`, Android 12+ derives unspecified bar colors from Material You system palettes. Explicit color fields still win. |
610
+ | **`tint`** | <code>string</code> | Tint color for active buttons/items. |
611
+ | **`inactiveTint`** | <code>string</code> | Color for inactive tab items. |
612
+ | **`background`** | <code>string</code> | Optional background tint. Ignored on iOS 26+ so UIKit can preserve the system Liquid Glass navigation appearance. |
613
+ | **`foreground`** | <code>string</code> | Title and label text color where the native platform supports it. |
614
+ | **`badgeBackground`** | <code>string</code> | Badge background color for native tab badges. |
615
+ | **`badgeText`** | <code>string</code> | Badge text color for native tab badges. |
616
+ | **`indicator`** | <code>string</code> | Active tab indicator color on Android. |
617
+ | **`ripple`** | <code>string</code> | Tab press ripple color on Android. |
618
+
619
+
620
+ #### NativeNavigationNavbarOptions
621
+
622
+ Native navbar state.
623
+
624
+ | Prop | Type | Description |
625
+ | ----------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
626
+ | **`hidden`** | <code>boolean</code> | Hide the native navbar. |
627
+ | **`title`** | <code>string</code> | Main title. |
628
+ | **`subtitle`** | <code>string</code> | Secondary title where supported by the platform. |
629
+ | **`large`** | <code>boolean</code> | Prefer a large iOS title style. |
630
+ | **`transparent`** | <code>boolean</code> | Prefer transparent/scroll-edge style. |
631
+ | **`blurEffect`** | <code><a href="#nativenavigationblureffect">NativeNavigationBlurEffect</a></code> | iOS blur/material effect for the navbar background when glass is not available. Defaults to `systemChromeMaterial` for transparent bars. |
632
+ | **`backButton`** | <code><a href="#nativenavigationbackbutton">NativeNavigationBackButton</a></code> | Back button state. |
633
+ | **`leftItems`** | <code>NativeNavigationBarButton[]</code> | Left-side action buttons. |
634
+ | **`rightItems`** | <code>NativeNavigationBarButton[]</code> | Right-side action buttons. |
635
+ | **`colors`** | <code><a href="#nativenavigationcolors">NativeNavigationColors</a></code> | Navbar color hints. |
636
+ | **`animated`** | <code>boolean</code> | Animate native navbar changes. |
637
+
638
+
639
+ #### NativeNavigationBackButton
640
+
641
+ Native back button configuration.
642
+
643
+ | Prop | Type | Description |
644
+ | ------------- | -------------------- | -------------------------------- |
645
+ | **`visible`** | <code>boolean</code> | Show the native back affordance. |
646
+ | **`title`** | <code>string</code> | Optional back title. |
647
+
648
+
649
+ #### NativeNavigationBarButton
650
+
651
+ A button shown in the native navbar.
652
+
653
+ | Prop | Type | Description |
654
+ | ------------- | --------------------------------------------------------------------- | -------------------------------------------------- |
655
+ | **`id`** | <code>string</code> | Stable id returned in `navbarItemTap`. |
656
+ | **`title`** | <code>string</code> | Visible text label. |
657
+ | **`icon`** | <code><a href="#nativenavigationicon">NativeNavigationIcon</a></code> | Native icon descriptor. |
658
+ | **`enabled`** | <code>boolean</code> | Whether the action is enabled. Defaults to `true`. |
659
+
660
+
661
+ #### NativeNavigationIcon
662
+
663
+ A serializable icon descriptor. Framework nodes are intentionally not accepted
664
+ because icons are rendered by native UI.
665
+
666
+ | Prop | Type | Description |
667
+ | -------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
668
+ | **`src`** | <code>string</code> | Cross-platform asset path or URL fallback. |
669
+ | **`svg`** | <code>string</code> | Cross-platform inline SVG markup. The native renderers support common icon shapes such as path, line, polyline, polygon, circle, and rect. SVG icons are rendered as template images by default so native tint colors still apply. |
670
+ | **`width`** | <code>number</code> | Preferred rendered icon width in native points/dp. Defaults to `24`. |
671
+ | **`height`** | <code>number</code> | Preferred rendered icon height in native points/dp. Defaults to `24`. |
672
+ | **`template`** | <code>boolean</code> | When `true`, native tint colors are applied to the rendered SVG/image. Defaults to `true`. |
673
+ | **`ios`** | <code>{ sfSymbol?: string; image?: string; svg?: string; }</code> | iOS-specific SF Symbol, bundled image name, or inline SVG. |
674
+ | **`android`** | <code>{ resource?: string; image?: string; svg?: string; }</code> | Android-specific drawable resource, asset name, or inline SVG. |
675
+
676
+
677
+ #### NativeNavigationTabbarOptions
678
+
679
+ Native tabbar state.
680
+
681
+ | Prop | Type | Description |
682
+ | -------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
683
+ | **`hidden`** | <code>boolean</code> | Hide the native tabbar. |
684
+ | **`tabs`** | <code>NativeNavigationTab[]</code> | Tab definitions. |
685
+ | **`selectedId`** | <code>string</code> | Currently selected tab id. |
686
+ | **`labels`** | <code>boolean</code> | Show text labels. Defaults to `true`. |
687
+ | **`labelVisibilityMode`** | <code><a href="#nativenavigationtablabelvisibilitymode">NativeNavigationTabLabelVisibilityMode</a></code> | Native label visibility mode. Overrides `labels` when provided. |
688
+ | **`icons`** | <code>boolean</code> | Show icons. Defaults to `true`. |
689
+ | **`colors`** | <code><a href="#nativenavigationcolors">NativeNavigationColors</a></code> | Tabbar color hints. |
690
+ | **`blurEffect`** | <code><a href="#nativenavigationblureffect">NativeNavigationBlurEffect</a></code> | iOS blur/material effect for the tabbar background when glass is not available. |
691
+ | **`disableIndicator`** | <code>boolean</code> | Disable the Android active tab indicator. |
692
+ | **`indicatorColor`** | <code>string</code> | Active tab indicator color on Android. `colors.indicator` is also supported. |
693
+ | **`rippleColor`** | <code>string</code> | Tab press ripple color on Android. `colors.ripple` is also supported. |
694
+ | **`badgeBackgroundColor`** | <code>string</code> | Badge background color. `colors.badgeBackground` is also supported. |
695
+ | **`badgeTextColor`** | <code>string</code> | Badge text color. `colors.badgeText` is also supported. |
696
+ | **`animated`** | <code>boolean</code> | Animate native tabbar changes. |
697
+
698
+
699
+ #### NativeNavigationTab
700
+
701
+ A native tab item.
702
+
703
+ | Prop | Type | Description |
704
+ | ------------------ | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
705
+ | **`id`** | <code>string</code> | Stable tab id returned in `tabSelect`. |
706
+ | **`title`** | <code>string</code> | Visible tab label. |
707
+ | **`icon`** | <code><a href="#nativenavigationicon">NativeNavigationIcon</a></code> | Native icon descriptor. |
708
+ | **`selectedIcon`** | <code><a href="#nativenavigationicon">NativeNavigationIcon</a></code> | Optional selected-state icon. |
709
+ | **`badge`** | <code>string \| number</code> | Optional badge. Numeric badges are supported on both platforms; text badge support depends on platform capabilities. |
710
+ | **`enabled`** | <code>boolean</code> | Whether the tab is enabled. Defaults to `true`. |
711
+
712
+
713
+ #### NativeNavigationTransitionResult
714
+
715
+ Native transition result.
716
+
717
+ | Prop | Type |
718
+ | --------------- | --------------------------------------------------------------------------------------------------- |
719
+ | **`id`** | <code>string</code> |
720
+ | **`direction`** | <code><a href="#nativenavigationtransitiondirection">NativeNavigationTransitionDirection</a></code> |
721
+ | **`duration`** | <code>number</code> |
722
+
723
+
724
+ #### NativeNavigationBeginTransitionOptions
725
+
726
+ Begin a native transition transaction before JS changes route content.
727
+
728
+ | Prop | Type | Description |
729
+ | ------------------ | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
730
+ | **`id`** | <code>string</code> | |
731
+ | **`direction`** | <code><a href="#nativenavigationtransitiondirection">NativeNavigationTransitionDirection</a></code> | |
732
+ | **`duration`** | <code>number</code> | |
733
+ | **`sourceRect`** | <code><a href="#nativenavigationrect">NativeNavigationRect</a></code> | Source rectangle for `zoom` transitions. Use viewport coordinates such as those returned by `Element.getBoundingClientRect()`. |
734
+ | **`targetRect`** | <code><a href="#nativenavigationrect">NativeNavigationRect</a></code> | Destination rectangle for shared-element-style `zoom` transitions. |
735
+ | **`cornerRadius`** | <code>number</code> | Corner radius used while animating a `zoom` transition. |
736
+
737
+
738
+ #### NativeNavigationRect
739
+
740
+ A rectangle in WebView viewport coordinates, expressed in native points/dp.
741
+
742
+ | Prop | Type |
743
+ | ------------ | ------------------- |
744
+ | **`x`** | <code>number</code> |
745
+ | **`y`** | <code>number</code> |
746
+ | **`width`** | <code>number</code> |
747
+ | **`height`** | <code>number</code> |
748
+
749
+
750
+ #### NativeNavigationFinishTransitionOptions
751
+
752
+ Finish a native transition transaction after JS has changed route content.
753
+
754
+ | Prop | Type | Description |
755
+ | ------------------ | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
756
+ | **`id`** | <code>string</code> | |
757
+ | **`direction`** | <code><a href="#nativenavigationtransitiondirection">NativeNavigationTransitionDirection</a></code> | |
758
+ | **`duration`** | <code>number</code> | |
759
+ | **`sourceRect`** | <code><a href="#nativenavigationrect">NativeNavigationRect</a></code> | Source rectangle for `zoom` transitions when no active source was recorded. |
760
+ | **`targetRect`** | <code><a href="#nativenavigationrect">NativeNavigationRect</a></code> | Destination rectangle for shared-element-style `zoom` transitions. |
761
+ | **`cornerRadius`** | <code>number</code> | Corner radius used while animating a `zoom` transition. |
762
+
763
+
764
+ #### PluginVersionResult
765
+
766
+ Plugin version payload.
767
+
768
+ | Prop | Type | Description |
769
+ | ------------- | ------------------- | ----------------------------------------------------------- |
770
+ | **`version`** | <code>string</code> | Version identifier returned by the platform implementation. |
771
+
772
+
773
+ #### PluginListenerHandle
774
+
775
+ | Prop | Type |
776
+ | ------------ | ----------------------------------------- |
777
+ | **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
778
+
779
+
780
+ #### NativeNavigationBackEvent
781
+
782
+ | Prop | Type |
783
+ | ------------ | --------------------- |
784
+ | **`source`** | <code>'navbar'</code> |
785
+
786
+
787
+ #### NativeNavigationBarItemTapEvent
788
+
789
+ | Prop | Type |
790
+ | --------------- | ------------------------------ |
791
+ | **`id`** | <code>string</code> |
792
+ | **`title`** | <code>string</code> |
793
+ | **`placement`** | <code>'left' \| 'right'</code> |
794
+
795
+
796
+ #### NativeNavigationTabSelectEvent
797
+
798
+ | Prop | Type |
799
+ | ----------- | ------------------- |
800
+ | **`id`** | <code>string</code> |
801
+ | **`index`** | <code>number</code> |
802
+ | **`title`** | <code>string</code> |
803
+
804
+
805
+ #### NativeNavigationSafeAreaChangedEvent
806
+
807
+ | Prop | Type |
808
+ | ------------ | ------------------------------------------------------------------------- |
809
+ | **`insets`** | <code><a href="#nativenavigationinsets">NativeNavigationInsets</a></code> |
810
+
811
+
812
+ #### NativeNavigationTransitionEvent
813
+
814
+ | Prop | Type |
815
+ | --------------- | --------------------------------------------------------------------------------------------------- |
816
+ | **`id`** | <code>string</code> |
817
+ | **`direction`** | <code><a href="#nativenavigationtransitiondirection">NativeNavigationTransitionDirection</a></code> |
818
+ | **`duration`** | <code>number</code> |
819
+
820
+
821
+ ### Type Aliases
822
+
823
+
824
+ #### NativeNavigationPlatformStyle
825
+
826
+ Platform rendering preference for the native bars.
827
+
828
+ <code>'auto' | 'ios' | 'android'</code>
829
+
830
+
831
+ #### NativeNavigationContentInsetMode
832
+
833
+ How the plugin exposes native bar sizes to web content.
834
+
835
+ <code>'css' | 'none'</code>
836
+
837
+
838
+ #### NativeNavigationBlurEffect
839
+
840
+ Native material/blur effect preference.
841
+
842
+ <code>'none' | 'systemDefault' | 'extraLight' | 'light' | 'dark' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark'</code>
843
+
844
+
845
+ #### NativeNavigationTabLabelVisibilityMode
846
+
847
+ Native tab label visibility behavior.
848
+
849
+ <code>'auto' | 'selected' | 'labeled' | 'unlabeled'</code>
850
+
851
+
852
+ #### NativeNavigationTransitionDirection
853
+
854
+ Navigation animation direction.
855
+
856
+ <code>'forward' | 'back' | 'root' | 'tab' | 'zoom' | 'none'</code>
857
+
858
+ </docgen-api>