Platform · mobileComing soon

Mobile

iPhone and Android apps through Capacitor, with storage, the back button, deep links and safe areas handled natively.

  • iOS
  • Android

Not on npm yet. @kitr/mobile is held back from the first release while it gets the same polish as the rest. It works from the repository today, and this page describes how it will ship.

Built onCapacitor
// app/components/shell.tsx
import { useBackButton, useSafeArea } from 'kitr/platform/react'
import { useCallback, type ReactNode } from 'react'

export function Shell({ children }: { children: ReactNode }) {
  const insets = useSafeArea()
  useBackButton(
    useCallback(({ canGoBack }) => canGoBack && window.history.back(), []),
  )
  return <main style={{ paddingTop: insets.top }}>{children}</main>
}

Native projects you own

The Xcode and Android Studio projects live in platforms/phone/. kitr dev adds them the first time and --target ios picks one.

Live reload on the device

The app on your phone loads the dev server over the network, so a saved file shows up on the device in a second.

Hooks for the device

usePlatform, useAppState, useBackButton, useDeepLink and useSafeArea answer the same way in the browser and in the app.

Storage that survives

Storage items move to Capacitor Preferences, which iOS and Android keep when they clear a webview to free space.

Same commands as every platform

Every platform answers to kitr dev, kitr build and kitr start, by the name you gave it. Leave the name off to run them all.

kitr dev phone
live reload on a device or simulator, port 3100
kitr build phone
the web build synced into ios/ and android/
kitr doctor
checks Xcode and Android Studio

Packages that work here

23 packages run on mobile. Each one is a single kitr add away.

All packages →

Switch to native hereTheir drivers switch to the native APIs underneath, with no code change.

Learn more

Add another platform

Platforms share the app/ folder, so adding one is a command, not a rewrite.

Mix and match →