Skip to content

Native Features ​

Already wired ​

A mobile app starts with these in src/main:

FeatureWhat it does
System barsThe status and navigation bars follow the theme in light and dark
KeyboardThe focused input stays above the on-screen keyboard (with --ui)
Hapticshaptics plays the system's haptics through @capacitor/haptics, and vibrates on the web
Back buttonAndroid's back button and gesture close the app from a top-level page (with routing)
iOS swipe backA swipe from the left edge goes back (with routing, native.ios.swipeBack)
App LinksLinks to the app's domain open the app (with routing)
Live updates and native updatesWith --push; see App Updates

Available as entities ​

Device features in @inglorious/web/device are types like any other: an entity holds their state, events drive them, and each works in the browser and switches to a Capacitor plugin in the native app when you pass one. Install the plugin, then register the type:

js
import { Share } from "@capacitor/share"
import { createShare } from "@inglorious/web/device/share"

const types = { Share: createShare({ plugin: Share }) }
FeatureNative plugin
Share@capacitor/share
Storage@capacitor/preferences, or the Keychain and Keystore for secrets
Biometrics@capgo/capacitor-native-biometric
Local notifications@capacitor/local-notifications
Geolocation@capacitor/geolocation
CompassBrowser sensors
Network statusBrowser events
Page visibilityBrowser events
Media queriesBrowser events

The camera and photo library need no plugin: a file input that accepts images offers both in the native app. Add NSCameraUsageDescription to native.ios.infoPlist, or iOS closes the app when the camera opens.

UI primitives ​

Inglorious UI has the mobile pieces people expect: a bottom tab bar (BottomNavigation), a bottom sheet you drag to dismiss (Dialog with variant="sheet"), an action sheet, pull-to-refresh, and page transitions that slide in the direction of navigation. See Inglorious UI.

Released under the MIT License.