Skip to content
Pyreon Native · PMTC
multiplatform · iOS and Android

Build the website. Get the iPhone and Android apps.

PMTC compiles the components you build from Pyreon's primitives into SwiftUI for iOS and Jetpack Compose for Android. Your buttons, fields and lists become the platform's own views, with no JavaScript engine shipped to draw them. Experimental, and we mean it.

npm create @pyreon/multiplatform@latest my-app
Documentation
targets
web · iOS (SwiftUI) · Android (Jetpack Compose)
on the device
SwiftUI and Compose viewsNo JavaScript engine renders your UI. A <WebView> appears only where you put one.
feedback
1–9 msto compile the shared source in memory: pyreon-native check names what won't compile before Xcode opens.
status
experimentalWhat is proven on a device is listed in the public matrix on the multiplatform page.
The same small todo app, Today, built from one source file (examples/native-showcase/src/TodayApp.tsx) and running at once in Chromium (web, server-rendered and hydrated), an iOS Simulator (generated SwiftUI) and an Android emulator (generated Jetpack Compose), each screen shown from its status bar down to just below the list: three todos, typing "Pick up oat milk" and adding it, checking it off, removing it. Real screen captures with real input; waits shortened, typing sped up on the phones.The same small todo app, Today, built from one source file (examples/native-showcase/src/TodayApp.tsx) and running at once in Chromium (web, server-rendered and hydrated), an iOS Simulator (generated SwiftUI) and an Android emulator (generated Jetpack Compose), each screen shown from its status bar down to just below the list: three todos, typing "Pick up oat milk" and adding it, checking it off, removing it. Real screen captures with real input; waits shortened, typing sped up on the phones.
  1. Web · server-rendered HTML, hydrated
  2. iOS · generated SwiftUI
  3. Android · generated Compose, experimental
  • 22 canonical primitives in the next release (17 today), each with a web runtime and a SwiftUI and Compose emitdocs/src/content/docs/primitives.md; facts.md (22 canonical primitives)
  • ≈ 3 s from saving a .tsx file to the scaffolded app relaunched on the iOS simulator (warm, author-measured)docs/src/content/docs/native-dev-loop.md "Measured timings" (Apple-silicon Mac, iOS 18.5 simulator)
  • 4 required CI checks on every native change: real Xcode and Gradle builds that run UI tests on an iOS Simulator and an Android emulator, plus Swift and Kotlin emit validationdocs/src/content/docs/multiplatform.md status note; .github/workflows/native-device.yml

synthetic · author-run · M3 Max · record of 2026-11-05

Every result, including where we lose →
why teams pick it

Not a web page in an app costume.

  1. The platform's own views

    A generated Toggle is the iOS toggle and the Android switch, so the next OS redesign reaches your app without a Pyreon release. <Stack> becomes VStack and Column; <Field> becomes TextField.

  2. Signals become platform state

    signal() and computed() compile to @State and @Observable on iOS, and mutableStateOf and derivedStateOf on Android. There is no re-render model to learn or work around, on the web or on the device.

  3. Errors that name the problem

    Code outside the native subset almost always gets a warning that names the construct and the file, often the line too, in milliseconds, before Xcode or Gradle runs. --typecheck adds a real swiftc pass on macOS.

  4. Plain TypeScript keeps compilingnext release

    effect(), setTimeout and setInterval, Date, string and numeric enums, try/catch and a typed JSON.parse now lower to Swift and Kotlin instead of stopping the build.

the difference

The same screen, written twice by hand, or once.

ios/TodoApp.swift + android/TodoApp.kt

Two languages, two state models, two places to fix every bug. This is PMTC's real output for the file on the right, imports left out.

// iOS: SwiftUI
struct Todo: Codable {
  var id: Int
  var text: String
}

struct TodoApp: View {
  @PyreonAppStorage("todos") private var todos: [Todo] = []
  @State private var draft: String = ""
  private func add() {
    todos = (todos + [Todo(id: Int(Date().timeIntervalSince1970 * 1000), text: draft)])
    draft = ""
  }
  private func remove(_ id: Int) { todos = todos.filter({ t in t.id != id }) }
  var body: some View {
    VStack(spacing: 12) {
      TextField("What needs doing?", text: $draft)
      Button("Add") { add() }
      ForEach(todos, id: \.id) { t in
        HStack(spacing: 8) {
          Text(verbatim: "\(t.text)")
          Button("Remove") { remove(t.id) }
        }
      }
    }
  }
}

// Android: Jetpack Compose
@Serializable
data class Todo(var id: Long, var text: String)

@Composable
fun TodoApp() {
  var todos by rememberPyreonStorage<List<Todo>>("todos", listOf())
  var draft by remember { mutableStateOf("") }
  fun add() {
    todos = (todos + listOf(Todo(id = System.currentTimeMillis(), text = draft)))
    draft = ""
  }
  fun remove(id: Long) {
    todos = todos.filter({ t -> t.id != id })
  }
  Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
    TextField(value = draft, onValueChange = { text -> draft = text }, placeholder = { Text("What needs doing?") }, singleLine = true)
    Button(onClick = { add() }) {
      Text("Add")
    }
    LazyColumn {
      items(todos, key = { it.id }) { t ->
        Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
          Text(text = "${t.text}")
          Button(onClick = { remove(t.id) }) {
            Text("Remove")
          }
        }
      }
    }
  }
}
src/TodoApp.tsx

What you write. The same file also renders on the web.

import { signal } from '@pyreon/reactivity'
import { For } from '@pyreon/core'
import { useStorage } from '@pyreon/storage'
import { Stack, Inline, Text, Field, Button } from '@pyreon/primitives'

type Todo = { id: number; text: string }

export function TodoApp() {
  const todos = useStorage<Todo[]>('todos', [])
  const draft = signal('')

  const add = () => {
    todos.set([...todos(), { id: Date.now(), text: draft() }])
    draft.set('')
  }
  const remove = (id: number) => todos.set(todos().filter((t) => t.id !== id))

  return (
    <Stack gap="md">
      <Field value={draft()} onChangeText={(text) => draft.set(text)} placeholder="What needs doing?" />
      <Button onPress={add}>Add</Button>
      <For each={todos()} by={(t) => t.id}>
        {(t) => (
          <Inline gap="sm">
            <Text>{t.text}</Text>
            <Button onPress={() => remove(t.id)}>Remove</Button>
          </Inline>
        )}
      </For>
    </Stack>
  )
}
how it ships

Three steps from TSX to the App Store build.

  1. step 1

    You write TSX

    Primitives, signals and the Pyreon packages you already use on the web. One src/App.tsx.

  2. step 2

    PMTC compiles it

    At build time the compiler emits Swift for iOS and Kotlin for Android. A construct it can't lower almost always gets a named warning, in milliseconds.

  3. step 3

    Xcode and Gradle build it

    The generated source links against small Swift and Kotlin runtimes. What lands on the phone is a SwiftUI or Compose app. No JavaScript engine draws its screens.

One .tsx lowered by PMTC to the web, SwiftUI and Jetpack Compose A table of how one .tsx source lowers through the PMTC compiler: signal becomes a DOM binding on the web, @State in SwiftUI and mutableStateOf in Compose; <Stack> becomes a flex column div, VStack and Column; <Inline> a flex row, HStack and Row; <Field> an input, TextField and TextField; <Toggle> a switch input, Toggle and Switch; <Scroll> with <For> a keyed list, LazyVStack and LazyColumn. Rows light up one at a time. iOS and Android targets are experimental. PMTC · ONE .TSX, THREE TARGETS · NATIVE IS EXPERIMENTAL you write web iOS · SwiftUI Android · Compose PMTC signal(0)DOM binding@StatemutableStateOf<Stack>div · flex columnVStackColumn<Inline>div · flex rowHStackRow<Field>inputTextFieldTextField<Toggle>input · switchToggleSwitch<Scroll><For>div · keyed listLazyVStackLazyColumn no JavaScript engine on the phone · real SwiftUI and Compose views
runs on native today

The parts of your app that come along.

Anything bound to the DOM (a code editor, a rich-text editor) stays on the web, or runs inside a WebView with a two-way data bridge.

@pyreon/primitives
UI

The canonical primitives (22 in the next release) → SwiftUI and Compose views.

@pyreon/reactivity
state

signal, computed and effect → platform state.

@pyreon/router
navigation

Nested routes, guards, loaders and inbound deep links.

@pyreon/form
forms

Validated forms, proven on device.

@pyreon/store · state-tree · machine
state

Stores, models and state machines.

@pyreon/i18n · permissions
app logic

Translations and access rules.

@pyreon/storage
persistence

Persisted signals on the platform's own storage, on iOS and Android.

@pyreon/charts
charts

Every chart family, drawn natively.

@pyreon/hooks
device

useClipboard, useColorScheme, useFetch, useOnline and more.

@pyreon/toast
feedback

A native overlay over the same toast() queue.

@pyreon/rx
data

Collection transforms lower to native operations.

Design System
styling

styled(), rocketstyle, Element and coolgrid patterns lower too.

the dev loop

Fast enough to stay in flow.

Measured on an Apple-silicon Mac with the iOS 18.5 simulator and the scaffolded app. pyreon-native check --watch answers "will this run on the device?" without opening Xcode.

compile the shared source
1–9 ms
edit, rebuild, reinstall, relaunch
≈ 3 s
first run, from nothing to a running simulator
≈ 31 s
comment-only edits skip the native build
0 s
under the hood

Six packages, all on npm.

The runtimes ship as Swift and Kotlin source through npm, so the Pyreon side of your native targets resolves from the same lockfile as the web app. npm create @pyreon/multiplatform@latest wires it all up.

@pyreon/native-compiler
TypeScript

PMTC itself: TSX in, SwiftUI and Compose out.

@pyreon/native-cli
TypeScript

The pyreon-native binary: build, check, dev, assets, wire.

@pyreon/native-runtime-swift
Swift

Core iOS runtime: tokens, HTTP, JSON, charts engine.

@pyreon/native-runtime-kotlin
Kotlin

The Android twin, plus storage backends.

@pyreon/native-router-swift
Swift

The router API on NavigationStack.

@pyreon/native-router-kotlin
Kotlin

The router API on Compose state.

coming from

Coming from React Native / Expo or Flutter?

A counter

React Native / Expo
import { useState } from 'react'
import { Pressable, Text } from 'react-native'

export function Counter() {
  const [n, setN] = useState(0)
  return (
    <Pressable onPress={() => setN(n + 1)}>
      <Text>{n}</Text>
    </Pressable>
  )
}
Pyreon

Your JSX habits carry over; the component runs once and only the text updates. Expo is ahead where it counts for some teams: over-the-air updates (compiled native code cannot be patched that way), a much larger native SDK catalog and hosted builds. Pyreon gives you the platform's own SwiftUI and Compose views with no JavaScript engine, and a server-rendered website from the same source.

import { signal } from '@pyreon/reactivity'
import { Press, Text } from '@pyreon/primitives'

export function Counter() {
  const n = signal(0)
  return (
    <Press onPress={() => n.set(n() + 1)}>
      <Text>{n()}</Text>
    </Press>
  )
}

The same counter

Flutter
import 'package:flutter/material.dart';

class Counter extends StatefulWidget {
  const Counter({super.key});

  @override
  State<Counter> createState() => _CounterState();
}

class _CounterState extends State<Counter> {
  int n = 0;

  @override
  Widget build(BuildContext context) {
    return TextButton(
      onPressed: () => setState(() => n++),
      child: Text('$n'),
    );
  }
}
Pyreon

Flutter draws its own pixels and leads on animation, desktop and maturity: its mobile targets are production, ours are experimental. Pyreon emits the platform's own widgets, so an OS redesign arrives for free, and the web build is real HTML with server rendering and SEO rather than a canvas.

import { signal } from '@pyreon/reactivity'
import { Press, Text } from '@pyreon/primitives'

export function Counter() {
  const n = signal(0)
  return (
    <Press onPress={() => n.set(n() + 1)}>
      <Text>{n()}</Text>
    </Press>
  )
}
try it

Same component, three targets.

Pick a primitive and see what each platform gets. The output is abridged; the real emit adds tokens, accessibility and modifiers.

source
TSX · you write
<Stack gap="md">
  <Text>Hello</Text>
  <Text>World</Text>
</Stack>
Web · DOM
<div style="display:flex;
  flex-direction:column;
  gap:12px">
  <span>Hello</span>
  <span>World</span>
</div>
iOS · SwiftUI
VStack(spacing: 12) {
  Text("Hello")
  Text("World")
}
Android · Compose
Column(
  verticalArrangement =
    Arrangement.spacedBy(12.dp)
) {
  Text("Hello")
  Text("World")
}

Simulated: abridged output shown for illustration, not compiled live in this page. The real emit adds tokens, accessibility and modifiers.

  • Today, the showcase todo app, in Chromium (the web build: server-rendered HTML, hydrated): a "Today" heading with "2 left", an "Add a todo" field with an ember Add button, and three todos on paper cards (Water the basil, Book the dentist checked off, Call Grandma back), each with a checkbox and a Remove action.Today, the showcase todo app, in Chromium (the web build: server-rendered HTML, hydrated): a "Today" heading with "2 left", an "Add a todo" field with an ember Add button, and three todos on paper cards (Water the basil, Book the dentist checked off, Call Grandma back), each with a checkbox and a Remove action.
    Web · Chromium
  • Today, the showcase todo app, on an iOS Simulator (SwiftUI generated from the same TodayApp.tsx): the "Today" heading with "2 left", an "Add a todo" text field with an ember Add button, and three todos, each with a native iOS switch (Book the dentist on) and a Remove action.Today, the showcase todo app, on an iOS Simulator (SwiftUI generated from the same TodayApp.tsx): the "Today" heading with "2 left", an "Add a todo" text field with an ember Add button, and three todos, each with a native iOS switch (Book the dentist on) and a Remove action.
    iOS · SwiftUI
  • Today, the showcase todo app, on an Android emulator (Jetpack Compose generated from the same TodayApp.tsx): the "Today" heading with "2 left", a Material text field with an ember Add button, and three todos, each with a Material switch (Book the dentist on) and a Remove action.Today, the showcase todo app, on an Android emulator (Jetpack Compose generated from the same TodayApp.tsx): the "Today" heading with "2 left", a Material text field with an ember Add button, and three todos, each with a Material switch (Book the dentist on) and a Remove action.
    Android · Compose
what's included

Everything between your TSX and the store build.

  • npm create @pyreon/multiplatform@latest scaffolds the web, iOS and Android projects in one repo, deep-link scheme included
  • Canonical primitives, from Stack to Video, each a SwiftUI and a Compose view; the next release brings the set to 22
  • <Select> and date and time <Field>snext release with each platform's own picker
  • pyreon-native check --watch answers "will this run on the device?" in milliseconds
  • pyreon-native dev rebuilds, reinstalls and relaunches the simulator app in about 3 s (warm)
  • Module-scope signalsnext release become one observable singleton per file
  • useNativeModule calls a Swift or Kotlin class you write, and the platform compiler type-checks the calls
  • A two-way <WebView> hosts web-only pieces such as a code editor inside the native app
  • The native router: nested routes, guards, loaders and inbound deep links, cold and warm
  • Device-tested in CI: XCUITest on an iOS Simulator and Compose UI tests on an Android emulator gate every native change
recipes

Things to build with it.

next release
A countdown on three platforms

Timers lower to a small PyreonTimers runtime: main-thread callbacks after at least ms, and on iOS the timer keeps firing while the user scrolls, as in a browser. Start it in onMount and return the cleanup.

import { signal, computed } from '@pyreon/reactivity'
import { onMount } from '@pyreon/core'
import { Stack, Text, Button } from '@pyreon/primitives'

export function Countdown() {
  const left = signal(10)
  const done = computed(() => left() === 0)

  onMount(() => {
    const id = setInterval(() => {
      if (left() > 0) left.set(left() - 1)
    }, 1000)
    return () => clearInterval(id)
  })

  return (
    <Stack gap="md">
      <Text>{done() ? 'Lift off' : `T-minus ${left()}`}</Text>
      <Button onPress={() => left.set(10)}>Restart</Button>
    </Stack>
  )
}
next release
State shared across components

Module-scope signals become one observable singleton for the file (@Observable on iOS, an object with mutableStateOf on Android), so every component in the file that reads them updates. The string enum becomes a native enum.

import { signal, computed } from '@pyreon/reactivity'
import { Stack, Inline, Text, Button } from '@pyreon/primitives'

enum Plan {
  Free = 'free',
  Pro = 'pro',
}

// Shared by every component in this file: one observable singleton natively.
const plan = signal<Plan>(Plan.Free)
const seats = signal(1)
const monthly = computed(() => (plan() === Plan.Pro ? 12 * seats() : 0))

export function PriceBadge() {
  return <Text>{`$${monthly()} a month`}</Text>
}

export function PlanPicker() {
  return (
    <Stack gap="md">
      <Inline gap="sm">
        <Button onPress={() => plan.set(Plan.Free)}>Free</Button>
        <Button onPress={() => plan.set(Plan.Pro)}>Pro</Button>
      </Inline>
      <Button onPress={() => seats.set(seats() + 1)}>Add a seat</Button>
      <Text>{`${seats()} seats`}</Text>
      <PriceBadge />
    </Stack>
  )
}
next release
Import pasted JSON safely

JSON.parse with a cast becomes a typed, throwing decode (JSONDecoder on iOS, kotlinx-serialization on Android), and try/catch maps one to one. Malformed JSON lands in the catch on every target; natively the decode is stricter, so a wrong-shaped list lands there too.

import { signal } from '@pyreon/reactivity'
import { Stack, Field, Text, Button } from '@pyreon/primitives'

type Contact = { name: string; email: string }

export function ImportContacts() {
  const raw = signal('')
  const count = signal(0)
  const problem = signal('')

  const importNow = () => {
    try {
      const list = JSON.parse(raw()) as Contact[]
      count.set(list.length)
      problem.set('')
    } catch (e) {
      problem.set('That is not a contact list')
    }
  }

  return (
    <Stack gap="md">
      <Field value={raw()} onChangeText={(t) => raw.set(t)} placeholder="Paste JSON" />
      <Button onPress={importNow}>Import</Button>
      <Text>{problem() === '' ? `${count()} contacts` : problem()}</Text>
    </Stack>
  )
}
api

Five names in your code, six packages underneath.

Every export has a reference page with its signature, an example and the mistakes people make with it.

in your code (@pyreon/primitives) · 5
  • useNativeModule
  • WebView
  • NativeIOS
  • NativeAndroid
  • Web
packages · 6
  • @pyreon/native-compiler
  • @pyreon/native-cli
  • @pyreon/native-runtime-swift
  • @pyreon/native-runtime-kotlin
  • @pyreon/native-router-swift
  • @pyreon/native-router-kotlin
good to know

Good to know before you start.

Experimental, and the matrix says how much

Each area is credited only for behaviour asserted on a simulator or emulator, and a CI gate keeps the headline equal to the table. Check it on the multiplatform page before you plan a release around it.

A subset of TypeScript compiles

Signals, typed props, the primitives, <For>/<Show> and the supported hooks lower. Run pyreon-native check while you write, and keep the rest in web-only files.

No over-the-air code updates

Native logic is compiled, so fixes ship through the stores. Data-driven config and <WebView> content are the ways to change behaviour between releases.

A rebuild loop, not hot reload

Native changes restart the app and reset in-memory state. Iterate on UI in the web build, where hot reload works.

Packages compile only with a port

PMTC lowers your source, not arbitrary npm packages. DOM-bound libraries stay on the web or run inside a <WebView>.

questions

What people ask first.

Is there a JavaScript engine on the phone?

Not for your UI or your logic: the build is Swift and Kotlin source compiled by Xcode and Gradle. A <WebView> you place on purpose (to host a code editor, say) runs web content inside the system web view, like any native app's.

Can I ship a store app with it today?

The native targets are experimental. Screens that are mostly forms, lists, navigation and data are the strong part; heavy animation and a long list of third-party SDKs are not. The matrix on the multiplatform page states what is proven on a device.

What happens when I write something it can't compile?

You almost always get a warning that names the construct and the file (often the line too), from pyreon-native check or the editor through pyreon-native check --lsp. It does not try to run unsupported code on the device.

How do I call a native SDK it doesn't wrap?

Write a Swift or Kotlin class in your app and call it with useNativeModule('Name'). Member calls pass straight through, so Xcode and Gradle type-check them. It is more glue than installing an Expo module.

Do I need a Mac?

For iOS, yes: Xcode builds the app, and --typecheck needs swiftc. Android builds with Gradle on any machine with the Android SDK, and the web build runs anywhere.

Your next app is already half written. It's your website.

npm create @pyreon/multiplatform@latest my-app
Read the multiplatform guide