NativeScript — Build Truly Native iOS and Android Apps with JavaScript or TypeScript
NativeScript lets you build iOS and Android apps with one JavaScript/TypeScript codebase that renders to native UI widgets (not WebView). Direct access to every iOS and Android API from JS.
What it is
NativeScript is an open-source framework for building native iOS and Android apps with JavaScript or TypeScript. Unlike hybrid frameworks that wrap web content in a WebView, NativeScript renders actual native UI widgets. It provides direct access to every iOS and Android API from JavaScript, with no bridge overhead for simple API calls.
NativeScript targets mobile developers who want native performance and platform API access while writing in JavaScript or TypeScript. It supports Angular, Vue, Svelte, and React as UI frameworks, or you can use plain TypeScript.
How it saves time or tokens
NativeScript uses one codebase for both iOS and Android while rendering native UI components. You avoid maintaining separate Swift/Kotlin codebases. Direct API access means you call platform APIs from JavaScript without writing native plugins for common tasks. The CLI provides hot reload during development, and the framework handles platform-specific adaptations automatically.
How to use
- Install the CLI with
npm install -g @nativescript/cliand runns doctorto verify your development environment (Xcode, Android SDK). - Create a new app with
ns create hello --template @nativescript/template-blank-ts. - Run on a simulator or device with
ns run iosorns run android.
Example
# Install CLI
npm install -g @nativescript/cli
ns doctor
# Create app with TypeScript template
ns create my-app --template @nativescript/template-blank-ts
cd my-app
# Run on iOS simulator
ns run ios
# Run on Android emulator
ns run android
// app/main-view-model.ts
import { Observable } from '@nativescript/core';
export class MainViewModel extends Observable {
private _counter = 0;
get message(): string {
return `Tapped ${this._counter} times`;
}
onTap(): void {
this._counter++;
this.notifyPropertyChange('message', this.message);
}
}
Related on TokRepo
- Coding AI Tools — Developer productivity and framework tools
- Automation Tools — Build and deployment automation
Common pitfalls
- NativeScript requires Xcode for iOS builds and Android SDK for Android builds. You cannot build iOS apps on Windows or Linux.
- Some npm packages that rely on browser APIs (DOM, window) do not work in NativeScript. Check plugin compatibility before depending on web-oriented packages.
- Performance-sensitive animations should use the NativeScript animation API rather than JavaScript timers. The animation API runs on the native UI thread.
Frequently Asked Questions
Both render native UI, but NativeScript provides direct access to every platform API from JavaScript without bridges for simple calls. React Native uses a bridge (or the new architecture with JSI) for native communication. NativeScript supports Angular, Vue, Svelte, and React, while React Native is React-only.
Yes, as long as they do not depend on browser-specific APIs like DOM or window. Many npm packages for business logic, data processing, and networking work fine. NativeScript-specific plugins are available for native device features.
Yes. The NativeScript CLI provides HMR (Hot Module Replacement) during development. Changes to TypeScript, CSS, and XML files are reflected on the device or simulator without a full rebuild.
Yes. NativeScript is fully open-source under the Apache 2.0 license. There are no paid tiers for the framework itself. Some third-party UI component libraries offer premium components.
NativeScript supports Angular, Vue.js, Svelte, React, and plain TypeScript/JavaScript. Each framework flavor has its own project template and component syntax while sharing the same native rendering engine.
Citations (3)
- NativeScript GitHub— NativeScript builds native iOS and Android apps with JavaScript/TypeScript using…
- NativeScript Documentation— Direct access to iOS and Android APIs from JavaScript
- NativeScript Official Site— NativeScript framework architecture and rendering
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.