Skip to content

Native controls enter Ionic WebView screens

Published

On 2026-11-18, Ionic published Masahiko Sakakibara’s account of placing native controls and native ads inside screens whose content and application logic remain on the web side. The work includes the @rdlabo/capacitor-native-ui plugin for supported Ionic controls and native ads in @capacitor-community/admob. WebView Native UI Engine coordinates native views with DOM layout and overlays (Ionic community spotlight).

The plugin does not replace an Ionic screen with a separately authored native screen. Supported controls are rendered with native iOS UI while their original elements and labels remain on the web side, along with selection state and handlers. Native interactions are passed back to those handlers, and the plugin visually hides the corresponding web controls while native presentation is active (Ionic community spotlight).

The author built the plugin after comparing web themes with Apple’s Liquid Glass rendering. The post shows tab bars and buttons rendered by the operating system on iOS 26 and 27. It lists support for toolbar buttons and button groups; back and menu buttons; segments and tab bars; floating action buttons; and lists, subject to placement restrictions in the supported-controls guide (Ionic community spotlight).

The plugin repository describes the same boundary in operational terms: it renders supported Ionic and HTML controls natively on iOS while the application retains state and routing, along with its handlers. Its requirements state that ordinary native rendering needs iOS 26 or later and Xcode 26 or later, while native startup requires Capacitor 8 and an iOS or Android project (Capacitor Native UI repository).

The repository separates setup routes because the adapters differ. Ionic apps have separate guides and imports for the standard iOS theme and an existing web theme. An HTML app without Ionic follows another route. This distinction matters during adoption: choose the guide matching the current markup instead of copying an adapter import from another setup (Capacitor Native UI repository).

The original Ionic elements stay in the DOM, but the blog says the plugin hides them visually and removes pointer interaction. It also removes them from web accessibility while showing native controls. The author had not fully verified VoiceOver or keyboard behavior. Switch Control behavior and the web fallback under Reduce Transparency also remained unverified, and the author explicitly recommends testing those cases in the adopting application (Ionic community spotlight).

That accessibility boundary is a release condition, not a cosmetic check. A team can verify that existing click and selection handlers still run, but that result does not establish focus order or assistive-technology naming. It also says nothing about fallback appearance. Record those observations separately on the supported iOS versions and keep the web-only theme available until the application’s own checks pass (Ionic community spotlight).

A native view placed above a WebView does not participate in the DOM’s stacking order. The Ionic post explains that increasing a web modal’s z-index cannot place it above that native view. The plugin lets an Ionic modal cover native controls and then restores the interactive controls after the modal closes (Ionic community spotlight).

WebView Native UI Engine packages the coordination used for this handoff. Its repository says a plugin supplies a native view and a DOM container. The engine coordinates DOM measurement and supported native scroll tracking, as well as transitions between native and web presentation. When the web layer needs presentation control, the engine places a prepared image of the native component in the DOM container (WebView Native UI Engine repository).

The projected image is not a second interactive control. The engine documentation says it does not forward clicks or play live video, and a configured web fallback is used when a suitable image is unavailable. Capture limits can also change the appearance of Liquid Glass highlights, so a screenshot handoff must be checked against the backgrounds used by the app (WebView Native UI Engine repository).

Ionic applications using an engine-enabled plugin can connect overlay lifecycle events with the engine’s Ionic integration. Call the documented helper once during application startup unless the plugin already enables it (WebView Native UI Engine repository).

import { enableSupportIonicOverlays } from "@webview-native-ui/engine/ionic";
enableSupportIonicOverlays();

The expected observation is that a supported overlay can own the visible web layer while native controls are projected, then interactive native presentation returns after dismissal. If the plugin already owns this setup, do not initialize a duplicate integration; follow that plugin’s overlay guide and keep its configured web fallback available for a failed or ineligible capture (WebView Native UI Engine repository).

The Ionic article also describes native ads placed between posts in a web feed. The ads remain Google Mobile Ads SDK views, while the surrounding text and images are web content. It reports that this feature is available in @capacitor-community/admob 8.3.0 or later and requires Capacitor 8.5 or later (Ionic community spotlight).

The plugin’s native-ads documentation defines a concrete setup. Create one NativeAdFeed manager for each visible feed screen after AdMob initialization and consent, then place a custom element with a stable feed-id and slot-key in the feed. The key identifies the logical ad item, not its array index or a recycled DOM node (AdMob native ads documentation).

import { NativeAdFeed } from "@capacitor-community/admob";
const nativeAds = await NativeAdFeed.create({
feedId: "home-feed",
isTesting: true,
scrollElement: await ionContent.getScrollElement(),
androidScrollSnapshot: true,
});
<capacitor-admob-native
feed-id="home-feed"
slot-key="sponsored-after-article-42"
></capacitor-admob-native>

Use test ads during development. The documentation says NativeAdFeed.create() rejects outside iOS and Android, including browsers and PWAs, instead of leaving an empty slot. Catch that rejection and render the feed without the native-ad row; do not leave reserved space waiting for a view that cannot be created (AdMob native ads documentation).

On iOS, passing the actual Ionic scroll element enables native scroll tracking for that container, but it does not change gesture routing: a pan beginning on the native ad may not reach the WebView scroll container. If the container cannot be identified unambiguously, the update fails and ads remain hidden. The documented recovery is one overflow container without transforms or zoom. Nested scrolling and virtual scrolling are outside this support route, as is document scrolling through this option (AdMob native ads documentation).

On Android, androidScrollSnapshot: true displays a cached image in the web feed during scrolling and restores the native view when scrolling stops. The native view continues tracking if a snapshot is unavailable or not ready. It also continues when the snapshot exceeds the supported size. The snapshot does not forward clicks or synthesize impressions; the Google SDK view remains responsible for ad interaction (AdMob native ads documentation).

The feed also needs an explicit overlay lifecycle. Native ads cannot infer that an Ionic modal, popover, menu, loading indicator, or route transition covers their slot. Await pause() before presenting the overlay, resume after dismissal, call invalidateLayout() after application-driven reflow, and destroy the manager when leaving the screen (AdMob native ads documentation).

await nativeAds.pause();
await modal.present();
await modal.onDidDismiss();
nativeAds.resume();
// When leaving the feed screen:
await nativeAds.destroy();

If pause() rejects, do not present an overlay over a native placement that may still be visible. Keep the ad row out of the active layout or route through the screen’s non-ad fallback, then log the failed native hide operation for diagnosis. This follows the documentation’s guarantee that pause() rejects when its native hide update fails (AdMob native ads documentation).

The integration moves more presentation into native views without moving routing and business state out of the web application. That can preserve existing handlers and Ionic state, but it adds native-project requirements and adapter-specific setup. View capture limits and lifecycle calls also introduce paths that a browser-only build does not exercise (Capacitor Native UI repository; WebView Native UI Engine repository).

A release check should therefore use the actual Capacitor projects. Verify that a supported control invokes the existing handler. Check that a modal covers and restores the control, then confirm that an ad follows the documented scroll container. The feed should disappear cleanly on an unsupported platform (Ionic community spotlight).

Keep the failure paths visible in product code. The plugin repository retains web themes and HTML adapters, the engine supports a configured web fallback when projection is unavailable, and the ad API rejects unsupported environments. Those are separate recovery routes: a control can remain web-rendered, an overlay can use a web projection or fallback, and a feed can omit the native-ad row (Capacitor Native UI repository; WebView Native UI Engine repository; AdMob native ads documentation).

  • Workbox: follow this entry for Workbox modules and service-worker tooling.
  • Debugging service workers: follow this entry for inspecting, updating, and bypassing a service worker.
  • Lighthouse: follow this entry for Lighthouse audits and interpreting their results.

Full VoiceOver, keyboard, and Switch Control behavior for the native-control plugin remains unverified in the Ionic author’s report. The appearance of its web fallback with Reduce Transparency also remains unverified (Ionic community spotlight).

Whether a particular application’s modal stack, DOM transforms, ad inventory, consent flow, and distribution review behave as intended remains unconfirmed. Test those properties in the app’s own native projects before release.

Whether these integrations meet a particular application’s requirements for frame timing, input latency, accessibility output, memory use, and scroll drift on a named device remains unconfirmed. The documented implementations provide the routes to measure (Capacitor Native UI repository; WebView Native UI Engine repository; AdMob native ads documentation).