Voltra is a React Native library that enables developers to build iOS Live Activities, Dynamic Island layouts, and Android Home Screen Widgets using JSX, eliminating the need to write native Swift, Kotlin, or SwiftUI/Jetpack Compose Glance code directly. It leverages React Native's familiar development workflow, including Fast Refresh, and provides a unified approach for styling with React Native style props and platform-native modifiers. Key features include support for ActivityKit push tokens and FCM for server-driven updates, a new Flexbox layout engine for iOS (introduced in v1.2.0 via `Voltra.View`), and capabilities for server-driven widgets and charts (introduced in v1.3.0). The current stable package version is 1.4.0, with a release cadence that has included significant feature additions in recent minor versions. It is compatible with Expo Dev Client and bare React Native projects, using an Expo config plugin to automatically wire native extension targets. This library aims to streamline cross-platform native surface development for React Native engineers.
npm install voltraVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to create a basic iOS Live Activity or Android Widget using Voltra's JSX components and manage its lifecycle with the `useLiveActivity` hook. It showcases defining a native UI directly within React Native and configuring its behavior.
Ensure your project is configured to use Expo Dev Client. Add `"plugins": ["voltra"]` to your `app.json` and run `npx expo prebuild --clean` to generate the native extension targets, then rebuild your native app.
Update Voltra to version 1.1.2 or higher to ensure proper ESM compatibility. This release specifically addresses and restores the necessary patch.
To utilize Flexbox for layout on iOS, ensure you replace `VStack` or `HStack` with `Voltra.View` and apply standard React Native style props for layout.
Verify that `["voltra"]` is included in the `plugins` array within your `app.json`. Then, run `npx expo prebuild --clean` and rebuild your native application (`npx expo run:ios` or `npx expo run:android`) to ensure native modules are correctly compiled and linked.
Ensure you are using `import { Voltra } from 'voltra';` to correctly import the `Voltra` object. This provides access to its components like `VStack`, `Text`, and `View`.First, ensure `voltra` is installed correctly. Verify your bundler configuration supports package exports. If using an older React Native version, consider upgrading your development environment or checking for specific module resolution settings that might be required.