@rdlabo/capacitor-native-ui 0.0.0-stage → 2.0.0-1
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.
- package/LICENSE +21 -0
- package/Package.swift +23 -0
- package/README.md +66 -2
- package/RdlaboCapacitorNativeUi.podspec +17 -0
- package/android/build.gradle +69 -0
- package/android/proguard-rules.pro +0 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/dev/rdlabo/capacitor/nativeui/NativeUI.kt +51 -0
- package/android/src/main/java/dev/rdlabo/capacitor/nativeui/NativeUIPlugin.kt +192 -0
- package/android/src/main/java/dev/rdlabo/capacitor/nativeui/NativeUISnapshot.kt +57 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/core.d.ts +4 -0
- package/dist/core.js +3 -0
- package/dist/native/activation.d.ts +14 -0
- package/dist/native/activation.d.ts.map +1 -0
- package/dist/native/activation.js +305 -0
- package/dist/native/activation.js.map +1 -0
- package/dist/native/components/index.d.ts +19 -0
- package/dist/native/components/index.d.ts.map +1 -0
- package/dist/native/components/index.js +38 -0
- package/dist/native/components/index.js.map +1 -0
- package/dist/native/components/ion-back-button.d.ts +10 -0
- package/dist/native/components/ion-back-button.d.ts.map +1 -0
- package/dist/native/components/ion-back-button.js +21 -0
- package/dist/native/components/ion-back-button.js.map +1 -0
- package/dist/native/components/ion-button.d.ts +10 -0
- package/dist/native/components/ion-button.d.ts.map +1 -0
- package/dist/native/components/ion-button.js +25 -0
- package/dist/native/components/ion-button.js.map +1 -0
- package/dist/native/components/ion-buttons.d.ts +11 -0
- package/dist/native/components/ion-buttons.d.ts.map +1 -0
- package/dist/native/components/ion-buttons.js +30 -0
- package/dist/native/components/ion-buttons.js.map +1 -0
- package/dist/native/components/ion-fab.d.ts +10 -0
- package/dist/native/components/ion-fab.d.ts.map +1 -0
- package/dist/native/components/ion-fab.js +132 -0
- package/dist/native/components/ion-fab.js.map +1 -0
- package/dist/native/components/ion-menu-button.d.ts +13 -0
- package/dist/native/components/ion-menu-button.d.ts.map +1 -0
- package/dist/native/components/ion-menu-button.js +44 -0
- package/dist/native/components/ion-menu-button.js.map +1 -0
- package/dist/native/components/ion-segment.d.ts +11 -0
- package/dist/native/components/ion-segment.d.ts.map +1 -0
- package/dist/native/components/ion-segment.js +30 -0
- package/dist/native/components/ion-segment.js.map +1 -0
- package/dist/native/components/ion-tab-bar.d.ts +11 -0
- package/dist/native/components/ion-tab-bar.d.ts.map +1 -0
- package/dist/native/components/ion-tab-bar.js +50 -0
- package/dist/native/components/ion-tab-bar.js.map +1 -0
- package/dist/native/components/searchable-tabs.d.ts +20 -0
- package/dist/native/components/searchable-tabs.d.ts.map +1 -0
- package/dist/native/components/searchable-tabs.js +413 -0
- package/dist/native/components/searchable-tabs.js.map +1 -0
- package/dist/native/definitions.d.ts +237 -0
- package/dist/native/definitions.d.ts.map +1 -0
- package/dist/native/definitions.js +0 -0
- package/dist/native/extensions.d.ts +31 -0
- package/dist/native/extensions.d.ts.map +1 -0
- package/dist/native/extensions.js +122 -0
- package/dist/native/extensions.js.map +1 -0
- package/dist/native/foldable/fold-state.d.ts +5 -0
- package/dist/native/foldable/fold-state.d.ts.map +1 -0
- package/dist/native/foldable/fold-state.js +15 -0
- package/dist/native/foldable/fold-state.js.map +1 -0
- package/dist/native/foldable/types.d.ts +12 -0
- package/dist/native/foldable/types.d.ts.map +1 -0
- package/dist/native/foldable/types.js +0 -0
- package/dist/native/html.d.ts +9 -0
- package/dist/native/html.d.ts.map +1 -0
- package/dist/native/html.js +197 -0
- package/dist/native/html.js.map +1 -0
- package/dist/native/index.d.ts +10 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native/index.js +19 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/legacy-layout.d.ts +5 -0
- package/dist/native/legacy-layout.d.ts.map +1 -0
- package/dist/native/legacy-layout.js +27 -0
- package/dist/native/legacy-layout.js.map +1 -0
- package/dist/native/overlays/content.d.ts +4 -0
- package/dist/native/overlays/content.d.ts.map +1 -0
- package/dist/native/overlays/content.js +51 -0
- package/dist/native/overlays/content.js.map +1 -0
- package/dist/native/overlays/controller.d.ts +8 -0
- package/dist/native/overlays/controller.d.ts.map +1 -0
- package/dist/native/overlays/controller.js +285 -0
- package/dist/native/overlays/controller.js.map +1 -0
- package/dist/native/overlays/dialog-animation.d.ts +9 -0
- package/dist/native/overlays/dialog-animation.d.ts.map +1 -0
- package/dist/native/overlays/dialog-animation.js +53 -0
- package/dist/native/overlays/dialog-animation.js.map +1 -0
- package/dist/native/overlays/dismiss-animation.d.ts +4 -0
- package/dist/native/overlays/dismiss-animation.d.ts.map +1 -0
- package/dist/native/overlays/dismiss-animation.js +18 -0
- package/dist/native/overlays/dismiss-animation.js.map +1 -0
- package/dist/native/overlays/focus.d.ts +5 -0
- package/dist/native/overlays/focus.d.ts.map +1 -0
- package/dist/native/overlays/focus.js +59 -0
- package/dist/native/overlays/focus.js.map +1 -0
- package/dist/native/overlays/popover.d.ts +12 -0
- package/dist/native/overlays/popover.d.ts.map +1 -0
- package/dist/native/overlays/popover.js +110 -0
- package/dist/native/overlays/popover.js.map +1 -0
- package/dist/native/overlays/styles.d.ts +11 -0
- package/dist/native/overlays/styles.d.ts.map +1 -0
- package/dist/native/overlays/styles.js +167 -0
- package/dist/native/overlays/styles.js.map +1 -0
- package/dist/native/prehide.d.ts +8 -0
- package/dist/native/prehide.d.ts.map +1 -0
- package/dist/native/prehide.js +238 -0
- package/dist/native/prehide.js.map +1 -0
- package/dist/native/runtime.d.ts +7 -0
- package/dist/native/runtime.d.ts.map +1 -0
- package/dist/native/runtime.js +776 -0
- package/dist/native/runtime.js.map +1 -0
- package/dist/native/shared/bridge.d.ts +6 -0
- package/dist/native/shared/bridge.d.ts.map +1 -0
- package/dist/native/shared/bridge.js +18 -0
- package/dist/native/shared/bridge.js.map +1 -0
- package/dist/native/shared/candidate.d.ts +25 -0
- package/dist/native/shared/candidate.d.ts.map +1 -0
- package/dist/native/shared/candidate.js +106 -0
- package/dist/native/shared/candidate.js.map +1 -0
- package/dist/native/shared/clipping.d.ts +5 -0
- package/dist/native/shared/clipping.d.ts.map +1 -0
- package/dist/native/shared/clipping.js +26 -0
- package/dist/native/shared/clipping.js.map +1 -0
- package/dist/native/shared/control-options.d.ts +6 -0
- package/dist/native/shared/control-options.d.ts.map +1 -0
- package/dist/native/shared/control-options.js +17 -0
- package/dist/native/shared/control-options.js.map +1 -0
- package/dist/native/shared/crossfade.d.ts +12 -0
- package/dist/native/shared/crossfade.d.ts.map +1 -0
- package/dist/native/shared/crossfade.js +67 -0
- package/dist/native/shared/crossfade.js.map +1 -0
- package/dist/native/shared/diagnostics.d.ts +4 -0
- package/dist/native/shared/diagnostics.d.ts.map +1 -0
- package/dist/native/shared/diagnostics.js +18 -0
- package/dist/native/shared/diagnostics.js.map +1 -0
- package/dist/native/shared/dom.d.ts +46 -0
- package/dist/native/shared/dom.d.ts.map +1 -0
- package/dist/native/shared/dom.js +180 -0
- package/dist/native/shared/dom.js.map +1 -0
- package/dist/native/shared/events.d.ts +15 -0
- package/dist/native/shared/events.d.ts.map +1 -0
- package/dist/native/shared/events.js +17 -0
- package/dist/native/shared/events.js.map +1 -0
- package/dist/native/shared/icons.d.ts +8 -0
- package/dist/native/shared/icons.d.ts.map +1 -0
- package/dist/native/shared/icons.js +61 -0
- package/dist/native/shared/icons.js.map +1 -0
- package/dist/native/shared/modal.d.ts +10 -0
- package/dist/native/shared/modal.d.ts.map +1 -0
- package/dist/native/shared/modal.js +160 -0
- package/dist/native/shared/modal.js.map +1 -0
- package/dist/native/shared/projection-id.d.ts +4 -0
- package/dist/native/shared/projection-id.d.ts.map +1 -0
- package/dist/native/shared/projection-id.js +7 -0
- package/dist/native/shared/projection-id.js.map +1 -0
- package/dist/native/shared/toolbar-options.d.ts +13 -0
- package/dist/native/shared/toolbar-options.d.ts.map +1 -0
- package/dist/native/shared/toolbar-options.js +28 -0
- package/dist/native/shared/toolbar-options.js.map +1 -0
- package/dist/native/shared/vertical-bars-geometry.d.ts +10 -0
- package/dist/native/shared/vertical-bars-geometry.d.ts.map +1 -0
- package/dist/native/shared/vertical-bars-geometry.js +85 -0
- package/dist/native/shared/vertical-bars-geometry.js.map +1 -0
- package/dist/native/startup.d.ts +8 -0
- package/dist/native/startup.d.ts.map +1 -0
- package/dist/native/startup.js +70 -0
- package/dist/native/startup.js.map +1 -0
- package/dist/native/vertical-bars-web-search.d.ts +10 -0
- package/dist/native/vertical-bars-web-search.d.ts.map +1 -0
- package/dist/native/vertical-bars-web-search.js +90 -0
- package/dist/native/vertical-bars-web-search.js.map +1 -0
- package/dist/native/vertical-bars-web.d.ts +5 -0
- package/dist/native/vertical-bars-web.d.ts.map +1 -0
- package/dist/native/vertical-bars-web.js +422 -0
- package/dist/native/vertical-bars-web.js.map +1 -0
- package/dist/native-integration/index.d.ts +25 -0
- package/dist/native-integration/index.d.ts.map +1 -0
- package/dist/native-integration/index.js +33 -0
- package/dist/native-integration/index.js.map +1 -0
- package/dist/vertical-bars.d.ts +6 -0
- package/dist/vertical-bars.js +5 -0
- package/docs/appearance.md +45 -0
- package/docs/configuration.md +219 -0
- package/docs/framework-independent.md +107 -0
- package/docs/ionic-vertical-bars.md +173 -0
- package/docs/migration.md +184 -0
- package/docs/native-ui-extensions.md +394 -0
- package/docs/native-ui.md +528 -0
- package/docs/setup.md +224 -0
- package/docs/vertical-bars.md +431 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIButton.swift +71 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIButtons.swift +24 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIComponents.swift +19 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIFab.swift +80 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUISearchController.swift +439 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUISegment.swift +91 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUITabBar.swift +218 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIVerticalBars.swift +590 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIVerticalSearch.swift +118 -0
- package/ios/Sources/NativeUIPlugin/Extensions/NativeUI.swift +178 -0
- package/ios/Sources/NativeUIPlugin/Extensions/NativeUIRendering.swift +38 -0
- package/ios/Sources/NativeUIPlugin/NativeUIPlugin.swift +615 -0
- package/ios/Sources/NativeUIPlugin/Overlays/NativeUIOverlayController.swift +119 -0
- package/ios/Sources/NativeUIPlugin/Overlays/NativeUIOverlayHost.swift +75 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUIControlRendering.swift +21 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUICrossfade.swift +35 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUIHost.swift +8 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUISnapshot.swift +161 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUIVerticalBarsGeometry.swift +52 -0
- package/ios/Tests/NativeUIPluginTests/NativeUIExtensionTests.swift +165 -0
- package/ios/Tests/NativeUIPluginTests/NativeUISnapshotTests.swift +805 -0
- package/package.json +89 -4
- package/src/core.ts +14 -0
- package/src/native/activation.ts +385 -0
- package/src/native/components/index.ts +45 -0
- package/src/native/components/ion-back-button.ts +22 -0
- package/src/native/components/ion-button.ts +25 -0
- package/src/native/components/ion-buttons.ts +37 -0
- package/src/native/components/ion-fab.ts +151 -0
- package/src/native/components/ion-menu-button.ts +37 -0
- package/src/native/components/ion-segment.ts +27 -0
- package/src/native/components/ion-tab-bar.ts +50 -0
- package/src/native/components/searchable-tabs.ts +499 -0
- package/src/native/definitions.ts +274 -0
- package/src/native/extensions.ts +176 -0
- package/src/native/foldable/fold-state.ts +10 -0
- package/src/native/foldable/types.ts +4 -0
- package/src/native/html.ts +199 -0
- package/src/native/index.ts +32 -0
- package/src/native/legacy-layout.ts +21 -0
- package/src/native/overlays/content.ts +51 -0
- package/src/native/overlays/controller.ts +349 -0
- package/src/native/overlays/dialog-animation.ts +53 -0
- package/src/native/overlays/dismiss-animation.ts +15 -0
- package/src/native/overlays/focus.ts +64 -0
- package/src/native/overlays/popover.ts +120 -0
- package/src/native/overlays/styles.ts +181 -0
- package/src/native/prehide.ts +285 -0
- package/src/native/runtime.ts +979 -0
- package/src/native/shared/bridge.ts +18 -0
- package/src/native/shared/candidate.ts +162 -0
- package/src/native/shared/clipping.ts +24 -0
- package/src/native/shared/control-options.ts +20 -0
- package/src/native/shared/crossfade.ts +67 -0
- package/src/native/shared/diagnostics.ts +13 -0
- package/src/native/shared/dom.ts +304 -0
- package/src/native/shared/events.ts +14 -0
- package/src/native/shared/icons.ts +57 -0
- package/src/native/shared/modal.ts +157 -0
- package/src/native/shared/projection-id.ts +2 -0
- package/src/native/shared/toolbar-options.ts +49 -0
- package/src/native/shared/vertical-bars-geometry.ts +80 -0
- package/src/native/startup.ts +68 -0
- package/src/native/vertical-bars-web-search.ts +86 -0
- package/src/native/vertical-bars-web.ts +500 -0
- package/src/native-integration/index.ts +49 -0
- package/src/vertical-bars.ts +12 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Native UI (Preview)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Native UI (Preview)
|
|
6
|
+
|
|
7
|
+
Native UI is a **preview**. The earlier Native UI Shell was bundled with theme versions 1.2.0 and 1.2.1; this guide describes the split package and its renamed API. See [migration](migration.md#native-ui-naming-changes). Its API and supported controls may change before stable status. Stable status is planned after the official release of Xcode 27.1.
|
|
8
|
+
|
|
9
|
+
Native UI gives an Ionic app native navigation and action controls around its Web content. The optional Capacitor iOS plugin renders supported fixed Ionic controls with UIKit or SwiftUI and the system's Liquid Glass material. Page content, scrolling, application state and routing remain in Ionic's WebView.
|
|
10
|
+
|
|
11
|
+
Read [how projection works](../README.md#how-projection-works) for the shared DOM and native presentation model. Use this page as the supported-control and API reference. For first-time installation and a working example, start with [Ionic setup](setup.md) or [HTML setup](framework-independent.md).
|
|
12
|
+
|
|
13
|
+
## Enable Native UI
|
|
14
|
+
|
|
15
|
+
Already using the iOS theme? Follow [Add Native UI to your theme](https://github.com/rdlabo-dev/ionic-theme-ios27/blob/main/packages/theme-ios27/docs/add-native-ui.md). For other Web appearances, use [Native UI setup](setup.md).
|
|
16
|
+
|
|
17
|
+
Install the native package as a direct application dependency so Capacitor can discover it:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @rdlabo/capacitor-native-ui
|
|
21
|
+
npx cap sync ios
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Keep your existing Web styles and enable Native UI once at application startup. The iOS 27 theme is optional:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { enableNativeUI } from '@rdlabo/capacitor-native-ui';
|
|
28
|
+
|
|
29
|
+
void enableNativeUI();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`enableNativeUI()` also reads the WebView's effective top-left corner radius and applies it to page transitions. To configure only the transition without enabling native controls, call:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { configureNativeTransition } from '@rdlabo/capacitor-native-ui';
|
|
36
|
+
|
|
37
|
+
await configureNativeTransition();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Navigation and native builds
|
|
41
|
+
|
|
42
|
+
| Setup | Action |
|
|
43
|
+
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
44
|
+
| Theme's `iosTransitionAnimation` | Keep it; native transitions are already coordinated. |
|
|
45
|
+
| Ionic default or custom animation | Configure the [transition adapter](migration.md#native-ui-transition-adapter). |
|
|
46
|
+
| Plugin installed or updated | Run `npx cap sync ios`, then rebuild the native app. |
|
|
47
|
+
| SPM or CocoaPods | Keep the existing dependency manager; both are supported. |
|
|
48
|
+
| Optional CocoaPods-to-SPM migration | Run `npx cap spm-migration-assistant`, then link the generated `CapApp-SPM` package to the app target in Xcode. |
|
|
49
|
+
| Ordinary native glass | Requires Xcode 26+, Capacitor 8 and iOS 26+. |
|
|
50
|
+
| Web, Android, SSR or older iOS | Retain the Web implementation. |
|
|
51
|
+
|
|
52
|
+
No per-page registration, component list, native callback or Swift view controller is required.
|
|
53
|
+
|
|
54
|
+
This is an opt-in feature. The ordinary `@rdlabo/ionic-theme-ios27` theme entry point does not import Capacitor. Native runtime entry points require `@capacitor/core`, including in browser builds. Native sources are still detected and built by Capacitor's sync when `@rdlabo/capacitor-native-ui` is a direct dependency of a Capacitor project, even if the application does not call `enableNativeUI()`.
|
|
55
|
+
|
|
56
|
+
Native light/dark appearance is resolved from each source element’s computed style. See [Light and dark appearance](appearance.md) for theme inheritance, priority, live updates and the shared Vertical Bars behavior.
|
|
57
|
+
|
|
58
|
+
## Toolbar selection and grouping
|
|
59
|
+
|
|
60
|
+
Use `controls` to choose selection and grouping by placement:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const shell = await enableNativeUI({
|
|
64
|
+
controls: {
|
|
65
|
+
buttonGroup: 'verticalOnly',
|
|
66
|
+
button: true,
|
|
67
|
+
backButton: true,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Here, ordinary toolbar actions project individually and eligible rail actions can group. All six control fields accept `true`, `false`, `'horizontalOnly'`, or `'verticalOnly'`; omitted fields are `true`. For all automatic controls only in the rail, use `controls: 'verticalOnly'`. See [selection defaults](configuration.md#selection-defaults) for the complete table.
|
|
73
|
+
|
|
74
|
+
`button` selects ordinary actions inside or outside a group, including menu buttons. `buttonGroup` only groups already selected actions. With `buttonGroup: true, button: false`, no ordinary action projects without explicit selection. `backButton` independently selects back navigation, including back buttons inside `ion-buttons`; back buttons never join ordinary groups.
|
|
75
|
+
|
|
76
|
+
`ionic.auto` enables or disables automatic Ionic discovery. Explicit `data-native-ui` sources and extensions remain independent of both `controls` and `ionic.auto`.
|
|
77
|
+
|
|
78
|
+
Restart the runtime to change these startup options.
|
|
79
|
+
|
|
80
|
+
| Attribute | Applies in | `true` | `false` |
|
|
81
|
+
| ---------------------- | ----------------------- | ------------------------------------------------------ | --------------------------------------------------------- |
|
|
82
|
+
| `data-horizontal-bars` | Ordinary placement | Select the action, or allow grouping on `ion-buttons`. | Exclude the action, or disable grouping on `ion-buttons`. |
|
|
83
|
+
| `data-vertical-bars` | Vertical rail placement | Select the action, or allow grouping on `ion-buttons`. | Exclude the action, or disable grouping on `ion-buttons`. |
|
|
84
|
+
|
|
85
|
+
On a button/back button these attributes control selection; on `ion-buttons` they control grouping only. Neither is inherited. Missing, invalid or empty values use the matching `controls` default. Vertical action opt-ins and their eligibility rules are detailed in [Vertical Bars](vertical-bars.md#explicit-action-selection-and-local-grouping).
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<ion-buttons data-horizontal-bars="false" data-vertical-bars="true">
|
|
89
|
+
<ion-button fill="clear">First</ion-button>
|
|
90
|
+
<ion-button fill="clear">Second</ion-button>
|
|
91
|
+
</ion-buttons>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The horizontal actions above project individually when otherwise eligible.
|
|
95
|
+
The vertical attribute allows grouping but does not select the text-only children;
|
|
96
|
+
add `data-vertical-bars="true"` to each button to select them explicitly.
|
|
97
|
+
|
|
98
|
+
These settings do not remove CSS or change the source layout. If the app removes
|
|
99
|
+
the source group's glass styling, `controls: { buttonGroup: 'verticalOnly' }` also prevents a
|
|
100
|
+
shared native group surface. Existing component-mode, fixed-toolbar,
|
|
101
|
+
fill/color and shell opt-out requirements still apply. A horizontal clear button
|
|
102
|
+
inside `ion-buttons` can project individually when grouping is disabled or the
|
|
103
|
+
whole group does not qualify. Back buttons never become ordinary group members.
|
|
104
|
+
Horizontal local overrides are re-evaluated live; vertical placement retains its
|
|
105
|
+
per-page-visit rules. `data-projection="source|system"` remains a separate native
|
|
106
|
+
vertical appearance setting.
|
|
107
|
+
|
|
108
|
+
The standalone `enableVerticalControlArea()` defaults `controls` to `'verticalOnly'`. Explicit sources and extensions remain independent. Use one startup entry per application.
|
|
109
|
+
|
|
110
|
+
## Supported markup
|
|
111
|
+
|
|
112
|
+
The table below describes the ordinary Native UI. Vertical Bars uses the separate [toolbar action rules](vertical-bars.md#toolbar-actions).
|
|
113
|
+
|
|
114
|
+
| Ionic component | Supported appearance and placement | Native rendering |
|
|
115
|
+
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
116
|
+
| `ion-button` | `fill="default"`, or clear inside an ungrouped `ion-buttons`, in a fixed header/footer toolbar | Glass `UIButton` |
|
|
117
|
+
| `ion-buttons` | Fixed toolbar, two or more direct clear `ion-button` / `ion-menu-button` children sharing the theme glass | One `UIGlassEffect` surface with independent native buttons |
|
|
118
|
+
| `ion-back-button` | Standard icon and color in a fixed header/footer toolbar | Glass `UIButton`, using the resolved Ionic label/icon |
|
|
119
|
+
| `ion-menu-button` | Fixed toolbar, inside the theme glass `ion-buttons` | Glass `UIButton`; original Ionic menu toggle |
|
|
120
|
+
| `ion-tab-bar` | Fixed tabs, icon-only/label-only items, one icon per item, dot/text badges, selection and disabled state | `UITabBar` and `UITabBarItem` |
|
|
121
|
+
| `ion-segment` | Fixed toolbar, non-scrollable, text **or** one icon per item | `UISegmentedControl` |
|
|
122
|
+
| `ion-fab` / `ion-fab-button` / `ion-fab-list` | Glass FAB in an `ion-content` fixed slot; one main button and optional directional lists | Persistent glass `UIButton` per button; one FAB synchronization group |
|
|
123
|
+
|
|
124
|
+
For the ordinary Native UI, only supported iOS-mode components are eligible. Theme variables are not required; calling `enableNativeUI()` opts into native projection. Explicitly enabled Vertical Bars is mode-independent as described below. `ios-theme-disabled` and the legacy `ios26-disabled` on an element or ancestor always exclude it. A disabled theme on one tab/segment item keeps its whole group on the Web.
|
|
125
|
+
|
|
126
|
+
### Opt out of native projection
|
|
127
|
+
|
|
128
|
+
Use `data-native-ui="disabled"` (or the equivalent `native-ui-disabled` class) to disable only the iOS Native UI while keeping the Web theme. It excludes the element and all its descendants. Adding or removing the attribute or class at runtime automatically restores Web rendering or re-evaluates native eligibility.
|
|
129
|
+
|
|
130
|
+
Only the exact value `disabled` opts out; an empty or unknown value does not opt out. Remove the attribute to restore automatic Ionic projection. For explicitly declared HTML controls, restore the original `data-native-ui="button"` or `data-native-ui="back-button"` value instead. Alternatively, set `data-native-ui="disabled"` on a parent to disable a subtree while preserving its children's declarations. If the `native-ui-disabled` class is also present, remove it as well. This does not disable clicks or change the Web theme. The runtime-owned `data-native-ui-projected` marker is separate; applications should not set it. For the previous opt-out attribute, see [migration](migration.md#native-ui-naming-changes).
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<ion-toolbar data-native-ui="disabled">
|
|
134
|
+
<ion-button>Web glass button</ion-button>
|
|
135
|
+
</ion-toolbar>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
In ordinary placement, an explicit `data-native-ui="disabled"` or `.native-ui-disabled` opt-out inside a shared surface keeps that surface and its children on the Web, including button groups, tab bars, segments and FAB lists. This is different from disabling grouping with `buttonGroup`. Opting out of the search FAB or any part of the search footer disables native search integration; the tab bar can still render natively if it remains eligible.
|
|
139
|
+
|
|
140
|
+
### Placement requirements
|
|
141
|
+
|
|
142
|
+
Glass appearance alone is not enough. Ordinary projection requires fixed controls:
|
|
143
|
+
|
|
144
|
+
| Control or location | Eligibility |
|
|
145
|
+
| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
146
|
+
| Buttons, back buttons, menu-button groups and segments | Toolbar directly inside `ion-header` or `ion-footer`, with no `ion-content` ancestor around the control. |
|
|
147
|
+
| Buttons directly inside a header/footer, standalone toolbars, or toolbars/headers in scrolling content | Stay on the Web. |
|
|
148
|
+
| FAB | Must use the `ion-content` fixed slot. |
|
|
149
|
+
| Back button with `.ios-theme-vertical-bars` enabled | Can project outside a fixed toolbar, including routed content or a persistent app shell. Vertical Bars does not require `ios` mode. |
|
|
150
|
+
| Collapsed headers, opted-out controls and departed pages | Excluded. |
|
|
151
|
+
| Full-width foreground modal | Can participate in Vertical Bars; other overlay surfaces keep their own layout. |
|
|
152
|
+
|
|
153
|
+
Moving a projected control to an excluded location restores its Web rendering; moving it back re-evaluates eligibility. The application chooses where to enable Vertical Bars and which Ionic component mode to use.
|
|
154
|
+
|
|
155
|
+
### Tab layout
|
|
156
|
+
|
|
157
|
+
| Source layout | Result |
|
|
158
|
+
| -------------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
159
|
+
| Equal-width items with the default `layout="icon-top"` | Native stacked icon/label layout, including iPad and landscape. |
|
|
160
|
+
| `icon-start`, `icon-end`, `icon-bottom`, `icon-hide` or `label-hide` | Entire tab bar stays on the Web. |
|
|
161
|
+
| Unequal item widths | Entire tab bar stays on the Web. |
|
|
162
|
+
| Start, center or end placement | Follows the source bar, including RTL. |
|
|
163
|
+
| Directional `ion-icon` artwork | Preserves its rendered RTL flip. |
|
|
164
|
+
|
|
165
|
+
The native bar uses local compact horizontal and regular vertical size classes without changing the app's size class. Label size and weight follow the Web snapshot.
|
|
166
|
+
|
|
167
|
+
### Ordinary button grouping
|
|
168
|
+
|
|
169
|
+
These rules apply outside Vertical Bars:
|
|
170
|
+
|
|
171
|
+
| Source or setting | Result |
|
|
172
|
+
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
|
|
173
|
+
| Clear button inside `ion-buttons` | Can project individually. |
|
|
174
|
+
| Standalone clear, solid or outline button | Stays on the Web. |
|
|
175
|
+
| Grouping enabled with two or more eligible clear buttons | One native surface with separate actions. Menu buttons can join. |
|
|
176
|
+
| Single menu button | Uses its parent group as the surface. |
|
|
177
|
+
| Grouping disabled, mixed fills or unsupported group children | Eligible actions can still project individually. Explicit subtree opt-outs follow the shared-surface rules above. |
|
|
178
|
+
| Back button | Never joins an ordinary action group. |
|
|
179
|
+
|
|
180
|
+
### Unsupported content
|
|
181
|
+
|
|
182
|
+
The following remain on the Web; the plugin does not translate arbitrary application CSS into UIKit styles:
|
|
183
|
+
|
|
184
|
+
| Area | Unsupported configuration |
|
|
185
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
186
|
+
| Buttons | Custom button colors or custom back icons/colors. |
|
|
187
|
+
| Containers | Collapsing headers, toolbars inside scrolling content, and ordinary modal content. See the separate Vertical Bars modal policy below. |
|
|
188
|
+
| Segments | Scrollable/expanded segments and segment-view integration. |
|
|
189
|
+
| Content | Complex slots and unsupported SVG features. |
|
|
190
|
+
|
|
191
|
+
### Backgrounds and fallback handoffs
|
|
192
|
+
|
|
193
|
+
Native glass samples the Web content actually drawn behind it. Existing toolbar backgrounds and header blur still affect that content. For content to scroll beneath a header, use Ionic's normal translucent-header/fullscreen-content layout; the plugin does not move page content or override an application-owned opaque toolbar background.
|
|
194
|
+
|
|
195
|
+
While a Web input owns the software keyboard, ordinary controls return to Web rendering and are re-evaluated when it closes. This also covers iPad layouts where the keyboard does not move the visual viewport. A native search field keeps its own native keyboard and search surface.
|
|
196
|
+
|
|
197
|
+
When an existing control becomes unsupported, its Web source is painted before its native cover is removed. This avoids a blank handoff, but Web/UIKit updates are not atomic and can briefly overlap. This boundary behavior differs from ordinary page navigation, where unchanged shared native tabs are retained.
|
|
198
|
+
|
|
199
|
+
## State and events
|
|
200
|
+
|
|
201
|
+
### Menu actions
|
|
202
|
+
|
|
203
|
+
Menu buttons use Ionic's resolved default/configured icon or a supported slot icon/label. Native activation clicks the original `ion-menu-button`, preserving `menu` targeting. Non-default menu button types (`submit` / `reset`) remain on the Web. `disabled`, `autoHide`, menu availability and split-pane visibility follow the actual DOM. Opening a menu restores Web controls and retires their native covers; closing it reprojects eligible controls.
|
|
204
|
+
|
|
205
|
+
### Tab geometry and state updates
|
|
206
|
+
|
|
207
|
+
The DOM owns labels, SVG content, placement, selected values and application behavior. `ion-tab-bar` itself is the placement reference; UIKit owns internal margins and platter sizing.
|
|
208
|
+
|
|
209
|
+
| Source or viewport | Native behavior |
|
|
210
|
+
| --------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
211
|
+
| Source bar rectangle | Sizing proposal and placement anchor, accounting for UIKit's larger outer frame. |
|
|
212
|
+
| `tab-bar-position-start`, `tab-bar-position-center`, `tab-bar-position-end` | Horizontal anchor, including RTL; class changes reconcile automatically. |
|
|
213
|
+
| `slot="bottom"` / `slot="top"` | Retains the corresponding bottom/top edge. |
|
|
214
|
+
| Supported stacked layout and label typography | Follow the Web snapshot. UIKit can cap content width even with fill positioning. |
|
|
215
|
+
| Badge or title updates | Retain native item identities and remeasure at the same anchor. |
|
|
216
|
+
| Different native width or height | Does not reject projection; icons are not stretched to force CSS item widths. |
|
|
217
|
+
| Unrecognized native layout | Restores Web rendering. |
|
|
218
|
+
|
|
219
|
+
The Web theme's standard appearance targets are:
|
|
220
|
+
|
|
221
|
+
| Measurement | Target |
|
|
222
|
+
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
|
223
|
+
| Viewport at least 768px wide, 2 / 3 / 4 / 5 tabs | Platter widths near 188 / 274 / 336 / 414pt respectively. Smaller viewports retain phone sizing. |
|
|
224
|
+
| Bar height | 62pt |
|
|
225
|
+
| Selection height / inset | 54pt / 4pt |
|
|
226
|
+
| Adjacent buttons | Overlap like UIKit controls. |
|
|
227
|
+
|
|
228
|
+
These targets do not guarantee identical custom fonts, icons or labels; UIKit determines intrinsic width. Icon and label alignment is checked against simulator screenshots. The plugin measures the native tab subtree without private class names or fixed inset corrections.
|
|
229
|
+
|
|
230
|
+
The runtime rechecks:
|
|
231
|
+
|
|
232
|
+
- Structural changes, affected shadow roots and sizing.
|
|
233
|
+
- Page lifecycle events and overlays.
|
|
234
|
+
- Ancestor `display: none`, `hidden`, theme classes, component removal and disabled changes.
|
|
235
|
+
|
|
236
|
+
Native touch events are checked against the current DOM and revision before clicking the original Ionic element.
|
|
237
|
+
|
|
238
|
+
### Forms and segment values
|
|
239
|
+
|
|
240
|
+
For forms, retain `ion-button type="submit"` and the form's existing submit handler. An external form is still passed as `[form]="formRef"`. The plugin does not call `form.submit()`, add a second submit path or change Angular form ownership. Segment values retain their original type because the original `ion-segment-button` is clicked; programmatic value changes do not emit a synthetic `ionChange`.
|
|
241
|
+
|
|
242
|
+
### Text and artwork
|
|
243
|
+
|
|
244
|
+
Labels use native text. Local static SVGs and resolved `ion-icon` SVGs (including `name` and changes to `name`) are rasterized at the display scale and cached. Source projection preserves their colors; system projection of vertical toolbar buttons uses template icons tinted by SwiftUI. Tab SVGs that follow text color use native template rendering, so icons and labels change selection color together without waiting for another bridge image. Multicolor tab artwork retains its original colors. External references, `<use>`, animation, embedded HTML/images, SVG text and stylesheets are excluded. Web fonts and arbitrary slot layouts are not reproduced exactly.
|
|
245
|
+
|
|
246
|
+
### Touch, badges and accessibility
|
|
247
|
+
|
|
248
|
+
The native host accepts input only within native controls. Tab interaction and accessibility are provided by the standard [UITabBar](https://developer.apple.com/documentation/uikit/uitabbar) control. Empty areas pass touches to the WebView. Ionic iOS hides empty badges by default. An empty visible `ion-badge` becomes a native notification dot; a non-empty badge displays its text. Badge background and text colors come from computed DOM styles, including Ionic `color` palettes. Hidden or removed badges clear the native badge. Tabs use UIKit’s standard tab control for selection, touch behavior, badges and accessibility, retaining item identity across selection updates. UIKit owns the item layout within the measured bar, so arbitrary CSS item placement is not reproduced. Native controls expose names, disabled/selected traits and badges to accessibility; the source is hidden from Web accessibility while projected. This is not a guarantee of identical VoiceOver traversal between Web and UIKit.
|
|
249
|
+
|
|
250
|
+
## Searchable tabs
|
|
251
|
+
|
|
252
|
+
Existing `attachTabBarSearchable(tabBar, fabButton, footer)` registrations automatically use native search when their bottom tab bar and glass search controls are supported. No new component option, route, native setup or page listener is required. Ordinary tab bars continue using `UITabBar`; horizontal searchable groups use a persistent `UITabBarController`, `UITab` / `UISearchTab`, and `UISearchController`. The original Capacitor WebView continues to render results and handle navigation.
|
|
253
|
+
|
|
254
|
+
With vertical bars, the native rail keeps every tab and its selection. SwiftUI’s `searchable` and `searchToolbarBehavior(.minimize)` provide the system search button, field, dismissal control and transitions within the same native navigation surface. Apple determines their placement for the current device layout and focuses the native field when system search opens. Input, focus, clear and submit events use the same bridge as horizontal search. As soon as vertical bars are enabled, the Web projection places the registered search button above visible vertical tabs, or at the bottom of the rail when the tabs are hidden, and forwards activation to the original FAB. Native search replaces that Web projection when available. The Web search presentation also preserves vertical tabs.
|
|
255
|
+
|
|
256
|
+
Search registration does not bypass placement restrictions. Its searchbar and close button must be in fixed footer toolbars. Its trigger must belong to an `ion-fab[slot="fixed"]` directly inside `ion-content`, or directly on the existing non-scrolling `.ion-page` layout. A wrapper inside scrolling content is not a fixed slot.
|
|
257
|
+
|
|
258
|
+
For horizontal tabs, once a supported search layout has been measured, Native UI keeps the searchable controller while the registration is alive, including when the page is transitioning or temporarily unavailable (`available: false`). A first registration on a hidden page keeps ordinary tabs until the search controls can be measured. The same controller manages resting tabs and active search. When resting, its view is fitted to the source `ion-tab-bar` to preserve the ordinary tab platter’s source width. UIKit can limit the platter width for small tab groups. UIKit owns the search button's placement beside the tabs. If UIKit cannot fit a horizontal search group to the source layout, search stays on the Web. Eligible tabs remain native unless they would cover the Web search trigger; overlapping tabs also stay on the Web. Register before the destination page finishes entering (for example in `ionViewWillEnter`); projection begins once its search controls can be measured.
|
|
259
|
+
|
|
260
|
+
Opening search preserves the selected Ionic tab and does not automatically show the keyboard (`automaticallyActivatesSearch` stays off). Tap the field or call `ion-searchbar.setFocus()` for the keyboard. While search is active, Native UI freezes Web layout projection and holds Capacitor Keyboard resize at `none`; UIKit owns tab/search chrome without frame fitting during the session. Closing search restores the ordinary tabs to their source placement. Ordinary native tabs keep an optimistic selection until the Web `selected` state catches up. Input events and application `value` updates continue across the bridge until search closes. The trigger's resolved SVG, accessibility label and the search icon are projected from Ionic, including `ion-icon name`.
|
|
261
|
+
|
|
262
|
+
Native edits pass through Ionic's input handlers, preserving `ionInput` debounce, `ionChange`, `ionFocus`, `ionBlur`, and `ionClear`. Programmatic `value` changes do not emit `ionInput`; synchronous application corrections and stale native input are distinguished. Native editing owns marked text and the caret. Returning through the footer's close action retains the value and does not emit `ionCancel` or `ionClear`.
|
|
263
|
+
|
|
264
|
+
### Supported search configuration
|
|
265
|
+
|
|
266
|
+
| Area | Native support | Remains on the Web |
|
|
267
|
+
| -------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
268
|
+
| Search group | Registered searchable tabs with an iOS-mode glass searchbar. | General standalone searchbars and classic searchbars. |
|
|
269
|
+
| Keyboard and text settings | Standard search keyboard and default autocorrection/capitalization. | Custom input modes, return-key hints, min/max length, autocomplete, autocorrection or spellcheck settings. |
|
|
270
|
+
| Clear/cancel controls | Default clear control, no internal cancel button. | Custom clear icons or an internal cancel button. |
|
|
271
|
+
| State and focus | Synchronizes `disabled`, `placeholder`, `value` and `setFocus()`. | Unsupported group configurations use Web rendering. |
|
|
272
|
+
|
|
273
|
+
### Search lifetime and recovery
|
|
274
|
+
|
|
275
|
+
Page retirement, overlays, theme exclusion and lost native ownership close the native presentation and preserve the latest synchronized/application value. A later search starts from that closed state. The registration survives cached page transitions; reattaching on every return is not required. Bridge waits are finite. When an opening request loses the bridge, its pending Enter can complete through the existing Web animation. A disconnected bridge cannot recover native characters that were never delivered to JavaScript.
|
|
276
|
+
|
|
277
|
+
Replacing the registered `ion-searchbar` or its input retires the old editing session. The replacement keeps its own application value and starts a new native session when reopened.
|
|
278
|
+
|
|
279
|
+
While enabled, Native UI suppresses the WebView’s top scroll-edge effect because Ionic already paints the header edge. This prevents a second dark gradient when the OS and Web themes differ. The original setting is restored on destroy.
|
|
280
|
+
|
|
281
|
+
The native search controller remains visible over its own keyboard. Other projected controls are hidden while a Web input opens the keyboard. UIKit's own accessibility and Reduce Motion behavior apply to the standard controls; full VoiceOver traversal is not a verified parity guarantee.
|
|
282
|
+
|
|
283
|
+
## FAB behavior
|
|
284
|
+
|
|
285
|
+
FABs retain Ionic's `activated`, per-child `show`, `close()` and original click handlers. Multiple lists, initial expansion, small buttons and `edge` use each button's measured layout. The native side reflects Ionic's staggered visibility without adding another timer or open/close controller. Main-button icon changes crossfade using the resolved `closeIcon`; Reduce Motion disables this crossfade. Native FAB button instances persist across open/close updates. The source FAB stays projected throughout ordinary opening and closing.
|
|
286
|
+
|
|
287
|
+
### FAB eligibility
|
|
288
|
+
|
|
289
|
+
One unsupported child keeps the whole FAB on the Web, even when its list is closed.
|
|
290
|
+
|
|
291
|
+
| Area | Supported | Remains on the Web |
|
|
292
|
+
| ---------- | ----------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
293
|
+
| Appearance | Standard circular glass. | Colored solid buttons or custom host backgrounds/shapes/motion. |
|
|
294
|
+
| Content | Text and resolved static SVG/`ion-icon`, including RTL mirroring. | Unsupported artwork. |
|
|
295
|
+
| Actions | Original click handlers. | Submit/reset or `href` FABs. |
|
|
296
|
+
| Placement | `slot="fixed"` on a direct child of `ion-content`. | Non-fixed placement or `slot="fixed"` on a page sibling. |
|
|
297
|
+
|
|
298
|
+
For example, the demo's red-background `floating-action-button-fixed` page retains its Web appearance.
|
|
299
|
+
|
|
300
|
+
Custom host animation or transition declarations on the FAB, list or button keep the group on the Web until removed. Button transforms support the standard identity and hidden-child scale(0), not custom scaling. For children inside a `display:none` list, browsers can report a computed transform of `none` even when a custom transform is declared. Such transforms are checked when layout becomes available; the whole FAB then returns to Web if needed. The plugin does not parse application stylesheets or temporarily open lists to predict hidden layout.
|
|
301
|
+
|
|
302
|
+
## Transitions and recovery
|
|
303
|
+
|
|
304
|
+
The built-in `iosTransitionAnimation` waits for native retirement before starting the Web animation. Interactive progress and completion/cancellation are queued while that retirement is in progress. Stationary shared tabs are retained. First render and transitions without an animation builder are covered by the startup runtime and Ionic lifecycle events. Default Ionic and custom navigation builders can use the same integration through `withNativeUITransition()`, exported by `@rdlabo/ionic-theme-ios27`. See [Connect your navigation animation](ionic-vertical-bars.md#3-connect-your-navigation-animation) for the setup.
|
|
305
|
+
|
|
306
|
+
Ordinary native/Web handoffs share a 180ms opacity crossfade, including Vertical Bars in both directions. Outgoing visuals cannot receive input or accessibility focus. Reduce Motion and modal presentation use immediate handoffs; search controllers keep their UIKit-managed transition.
|
|
307
|
+
|
|
308
|
+
Tab switches skip the Web/native crossfade so a retiring UIKit snapshot cannot linger over the next tab. Detection uses the router URL versus the still-selected tab on `ionViewWillLeave` (and vanilla `ionTabsWillChange` / `ionTabsDidChange` DOM events). Stack pushes and pops keep the normal 180ms handoff.
|
|
309
|
+
|
|
310
|
+
Standard Ionic overlays suspend ordinary native projection until dismissal. Vertical Bars use a separate policy:
|
|
311
|
+
|
|
312
|
+
| Surface or condition | Vertical Bars behavior |
|
|
313
|
+
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
314
|
+
| Web toast, ordinary popover or legacy picker overlay | Keep the native rail visible, updated and interactive. |
|
|
315
|
+
| Popover opened from a Vertical Bars button, rendered on Web | Return the rail to Web projection until dismissal, including native rejection or preparation failure. |
|
|
316
|
+
| Alert, action sheet or loading | Restore Web rendering so the overlay and its dimming backdrop cover the controls correctly. |
|
|
317
|
+
| Menu | Keep the existing native rail behavior. |
|
|
318
|
+
| Full-width foreground modal | Project the modal's controls instead of the covered page's controls. |
|
|
319
|
+
| Modal that cannot use Vertical Bars | Restore Web rendering. |
|
|
320
|
+
| Explicit suspension, unavailable native layout, hidden document or unsupported keyboard/viewport geometry | Preserve the existing fallback behavior. |
|
|
321
|
+
|
|
322
|
+
Native projection resumes only after every overlay requiring Web rendering closes. The opt-in native Vertical Bars popover described below keeps its own SwiftUI presentation and input handling. Unsupported searchable-tab configurations use the existing Web animation and share this ownership with Web glass gestures. CSS motion of supported containing surfaces also causes temporary Web rendering.
|
|
323
|
+
|
|
324
|
+
During retirement, the source is restored and allowed to paint before its native cover is removed. During acquisition, the source is hidden only after a successful, current native response. Delayed responses are revalidated per control: existing eligible controls retain their native cover while content updates catch up. Only removed or ineligible sources return to Web; newly acquired sources require an exact acknowledgement. Ordinary page mutations never call the global clear operation. UIKit tab instances and items are retained, and equal frames/selections are not reapplied. Duplicate/stale activations are discarded. WebKit and UIKit still render separately: the implementation avoids an intentional blank frame, but does not provide an OS-level atomic compositing guarantee. Validate custom transitions and overlays on the app's supported simulators before rollout; unknown overlay systems are outside the automatic integration contract.
|
|
325
|
+
|
|
326
|
+
If a bridge update fails or times out, the runtime stops and restores Web rendering. It does not automatically reconnect. `getStatus()` reports `stopped` and the reason; to retry deliberately, call `destroy()` on that handle and then `enableNativeUI()` again.
|
|
327
|
+
|
|
328
|
+
Failures or timeouts in required startup bridge calls return a Web fallback handle. Optional WebView metrics may fail without disabling native controls. `destroy()` waits for teardown; repeated calls share its completion. A new activation requested while teardown is running waits for it, including when the application calls `destroy()` without awaiting it. Await these promises when the next application operation depends on cleanup, and handle any rejection.
|
|
329
|
+
|
|
330
|
+
For diagnostics or application teardown:
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
const shell = await enableNativeUI(); // repeated calls share the runtime
|
|
334
|
+
console.log(shell.getStatus()); // state, projected control count, update count, failure reason
|
|
335
|
+
await shell.destroy(); // restore DOM, remove native controls and release listeners/cache
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Projection is enabled by calling the startup API. Partial settings override defaults:
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
const shell = await enableNativeUI({ controls: { tabs: false } }); // automatic Ionic projection except tabs
|
|
342
|
+
await shell.disableVerticalControlArea(); // retain ordinary native controls
|
|
343
|
+
await shell.enableVerticalControlArea();
|
|
344
|
+
await shell.destroy(); // stop all projection
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
See [all configuration options](configuration.md) for defaults, rail-only usage and lifecycle methods. For explicit HTML sources without Ionic, see [framework-independent setup](framework-independent.md).
|
|
348
|
+
|
|
349
|
+
### Popovers anchored to Vertical Bars
|
|
350
|
+
|
|
351
|
+
**Native popover presentation is Vertical Bars only.** It requires an accepted native Vertical Bars `ion-button` anchor; enabling `ionic.verticalBars.popover` does not make ordinary toolbar or body popovers native. This feature also works with the standalone Vertical Bars runtime, without enabling the full Native UI.
|
|
352
|
+
|
|
353
|
+
Enable `ionic.verticalBars.popover` to present popovers from accepted native Vertical Bars `ion-button` controls. Automatic Ionic button projection is enabled by default; when `ionic.auto` is `false`, mark individual anchors with `data-native-ui="button"`:
|
|
354
|
+
|
|
355
|
+
```ts
|
|
356
|
+
await enableNativeUI({
|
|
357
|
+
ionic: { verticalBars: { popover: true } },
|
|
358
|
+
});
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
The same option is available through `enableVerticalControlArea()`. Use an `ion-popover` whose `trigger` identifies the projected button, or pass that button's click event to `PopoverController.create({ event, ... })`. The button must be accepted by native Vertical Bars; regular toolbar buttons, body controls, and missing or rejected anchors retain Ionic's Web presentation.
|
|
362
|
+
|
|
363
|
+
When Vertical Bars return to Web rendering, the runtime measures the current native back button, toolbar actions and tab surfaces before retiring them. Web fallback uses those rectangles and paints before native removal. Measurements are tied to the source elements and viewport; unavailable measurements use the CSS layout. This aligns placement and size, but the Web glass and icon rendering can still differ from system materials.
|
|
364
|
+
|
|
365
|
+
The page's native controls stay projected throughout preparation, presentation and dismissal. If the same native anchor accepts a tap while Ionic is still dismissing, one activation is retained and revalidated after cleanup; repeated taps coalesce. The relay prepares its child WebView while Ionic initializes the content, completes the Web enter animation without motion behind the hidden source host, and presents through the button's standard SwiftUI popover. It does not resize or reparent the source WebView. Ionic retains its controller, lifecycle, live application handlers and dismissal data; the live content temporarily moves into the child document and is restored during cleanup.
|
|
366
|
+
|
|
367
|
+
Only one popover is relayed at a time. A nested popover or modal created in the child document is moved as a live element back to the source document before the child closes, including overlays appended outside the relayed content. It continues as a Web overlay with its handlers and dismissal data; its presentation event is not replayed. Opening another overlay or menu, leaving the page, suspending the shell, or losing the native layout restores Web rendering. Modal, sheet and alert relay are outside this feature.
|
|
368
|
+
|
|
369
|
+
Native presentation owns the arrow, corners and animation; custom Web enter/leave animations do not replace them. The source enter builder runs once with zero duration and delay (including child animations), using the native anchor rectangle for the default `reference="trigger"` layout and visible state for Web fallback. Explicit `reference="event"` retains Ionic’s event-coordinate semantics. An explicit `enterAnimation` is honored; otherwise this package’s iOS popover builder is used. Set `enterAnimation` on the overlay to use a custom builder rather than relying on global `popoverEnter` configuration. Material Design (`md`) popovers keep Ionic’s Web presentation. Initial content dimensions come from Ionic.
|
|
370
|
+
|
|
371
|
+
#### Popover fallback conditions
|
|
372
|
+
|
|
373
|
+
The relay copies document and popover shadow styles and preserves content border spacing. Before presentation, it compares selected computed layout and appearance properties at the source dimensions.
|
|
374
|
+
|
|
375
|
+
| Condition | Result |
|
|
376
|
+
| --------------------------------------------------------- | ------------------------------ |
|
|
377
|
+
| Detected style/layout differences | Restores the live Web popover. |
|
|
378
|
+
| Unsupported ancestor visual effects or size containers | Restores the live Web popover. |
|
|
379
|
+
| Content exceeds 1,000 elements | Restores the live Web popover. |
|
|
380
|
+
| Mirrored ancestor attributes or source head styles change | Restores Web rendering. |
|
|
381
|
+
| Preparation fails or the native anchor is unavailable | Restores the Web popover. |
|
|
382
|
+
|
|
383
|
+
A rail-button popover falling back to Web also returns the rail to Web projection until dismissal. This compatibility check does not guarantee arbitrary CSS (including pseudo-elements and dynamic CSSOM changes), document-bound queries, or full VoiceOver/hardware-keyboard parity.
|
|
384
|
+
|
|
385
|
+
### Custom overlay suspension
|
|
386
|
+
|
|
387
|
+
For a custom modal or overlay that Native UI cannot detect, acquire a suspension before presenting it. The resolved suspension means projected controls have returned to Web rendering. Always release it after dismissal:
|
|
388
|
+
|
|
389
|
+
```ts
|
|
390
|
+
const suspension = await shell.suspend();
|
|
391
|
+
|
|
392
|
+
try {
|
|
393
|
+
await modal.present();
|
|
394
|
+
await modal.onDidDismiss();
|
|
395
|
+
} finally {
|
|
396
|
+
await suspension.resume();
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Suspensions are nestable and `resume()` is idempotent. Native projection resumes only after every active suspension has been released, using the current DOM rather than a stale snapshot.
|
|
401
|
+
|
|
402
|
+
The native material and control appearance follow the running iOS version; an iOS 26 device does not acquire iOS 27's appearance merely by installing this theme.
|
|
403
|
+
|
|
404
|
+
## Support iPhone Duo
|
|
405
|
+
|
|
406
|
+
iPhone Duo support, including standalone Vertical Bars, is stable starting with version 2.0.0.
|
|
407
|
+
|
|
408
|
+
The standalone Vertical Control Area entry point (`@rdlabo/capacitor-native-ui/vertical-bars`) works with application-supplied Web layout. The theme package offers an [optional rail stylesheet](https://github.com/rdlabo-dev/ionic-theme-ios27/blob/main/packages/theme-ios27/docs/vertical-bars-layout.md), `@rdlabo/ionic-theme-ios27/dist/css/vertical-bars.css`, which can be used without loading the full iOS 27 appearance. Call `enableNativeUI({ controls: 'verticalOnly' })` for this use case; its default selection targets controls placed in the vertical area. Apps already calling `enableNativeUI()` should keep that single runtime rather than starting both. See [iPhone Duo support](https://github.com/rdlabo-dev/ionic-theme-ios27/blob/main/packages/theme-ios27/docs/iphone-duo.md) for the complete setup, including hinge posture and the split-pane layout for apps that do not use this shell at all.
|
|
409
|
+
|
|
410
|
+
Vertical Bars uses a SwiftUI `TabView` and toolbar in the system rail. Ionic remains the source of labels, icons, selected/disabled state and actions. See [Vertical Bars](vertical-bars.md) for rail layout, native fallback and supported overlays.
|
|
411
|
+
|
|
412
|
+
In Vertical Bars, automatic selection of fixed-toolbar `ion-button` actions requires an `ion-icon` or SVG with `slot="icon-only"`; `data-vertical-bars="true"` can explicitly select other supported buttons. All fills and Ionic colors are eligible; submit buttons follow the same placement rule. Add `.ios-theme-horizontal-only` to a button or its `ion-buttons` group to keep it horizontal. See [Toolbar actions](vertical-bars.md#toolbar-actions) for placement and exclusion rules.
|
|
413
|
+
|
|
414
|
+
**Native button appearance:** Native vertical buttons default to `buttonProjection: 'system'`. Use `source` to project Ionic fill and colors, with `data-projection="source|system"` or the equivalent `ios-theme-projection-source` / `ios-theme-projection-system` classes for local exceptions. These settings affect native vertical `ion-button` and `ion-menu-button` actions only. Horizontal controls and Web clones keep their existing behavior. See [Choose button appearance](vertical-bars.md#choose-button-appearance) for priority and fill rules.
|
|
415
|
+
|
|
416
|
+
For standalone setup while keeping your existing theme, see [iPhone Duo with your existing theme](ionic-vertical-bars.md).
|
|
417
|
+
|
|
418
|
+
## Native UI API
|
|
419
|
+
|
|
420
|
+
The generated reference below documents the handle returned by `enableNativeUI()`. The underlying Capacitor bridge and its control-snapshot protocol are implementation details.
|
|
421
|
+
|
|
422
|
+
<docgen-index>
|
|
423
|
+
|
|
424
|
+
* [`enableVerticalControlArea()`](#enableverticalcontrolarea)
|
|
425
|
+
* [`disableVerticalControlArea()`](#disableverticalcontrolarea)
|
|
426
|
+
* [`markForCheck()`](#markforcheck)
|
|
427
|
+
* [`getStatus()`](#getstatus)
|
|
428
|
+
* [`suspend()`](#suspend)
|
|
429
|
+
* [`destroy()`](#destroy)
|
|
430
|
+
* [Interfaces](#interfaces)
|
|
431
|
+
|
|
432
|
+
</docgen-index>
|
|
433
|
+
|
|
434
|
+
<docgen-api>
|
|
435
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
436
|
+
|
|
437
|
+
A running shell. Placement changes preserve all other startup settings.
|
|
438
|
+
|
|
439
|
+
### enableVerticalControlArea()
|
|
440
|
+
|
|
441
|
+
```typescript
|
|
442
|
+
enableVerticalControlArea() => Promise<void>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Enable rail projection when available, preserving other settings. Rejects after destroy.
|
|
446
|
+
|
|
447
|
+
--------------------
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
### disableVerticalControlArea()
|
|
451
|
+
|
|
452
|
+
```typescript
|
|
453
|
+
disableVerticalControlArea() => Promise<void>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Restore rail sources to the Web without stopping ordinary native controls. Rejects after destroy.
|
|
457
|
+
|
|
458
|
+
--------------------
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
### markForCheck()
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
markForCheck() => void
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
Schedule a source recheck. Calls coalesce; unchanged snapshots are not sent. No-op after destroy or without a runtime.
|
|
468
|
+
|
|
469
|
+
--------------------
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
### getStatus()
|
|
473
|
+
|
|
474
|
+
```typescript
|
|
475
|
+
getStatus() => NativeUIStatus
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Returns the current Web/native projection state.
|
|
479
|
+
|
|
480
|
+
**Returns:** <code><a href="#nativeuistatus">NativeUIStatus</a></code>
|
|
481
|
+
|
|
482
|
+
--------------------
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
### suspend()
|
|
486
|
+
|
|
487
|
+
```typescript
|
|
488
|
+
suspend() => Promise<NativeUISuspension>
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
Restores projected controls to the Web until the returned lease is resumed.
|
|
492
|
+
|
|
493
|
+
**Returns:** <code>Promise<<a href="#nativeuisuspension">NativeUISuspension</a>></code>
|
|
494
|
+
|
|
495
|
+
--------------------
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
### destroy()
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
destroy() => Promise<void>
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Stops synchronization, restores Web controls and releases native resources.
|
|
505
|
+
|
|
506
|
+
--------------------
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
### Interfaces
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
#### NativeUIStatus
|
|
513
|
+
|
|
514
|
+
| Prop | Type |
|
|
515
|
+
| --------------- | ------------------------------------------- |
|
|
516
|
+
| **`state`** | <code>'native' \| 'stopped' \| 'web'</code> |
|
|
517
|
+
| **`projected`** | <code>number</code> |
|
|
518
|
+
| **`updates`** | <code>number</code> |
|
|
519
|
+
| **`reason`** | <code>string</code> |
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
#### NativeUISuspension
|
|
523
|
+
|
|
524
|
+
| Method | Signature | Description |
|
|
525
|
+
| ---------- | ---------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
526
|
+
| **resume** | () => Promise<void> | Releases this suspension. Native projection resumes after all active suspensions are released. |
|
|
527
|
+
|
|
528
|
+
</docgen-api>
|