Skip to content
Skills Library
Programming · Building & coding

nativescript

/nativescript

Expert NativeScript assistance covering direct native API access from JavaScript/TypeScript, XML layouts, custom native wrappers, and cross-platform app deployment. Use when building truly native mobile apps without WebViews using JavaScript or TypeScript.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
1
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Expert NativeScript assistance covering direct native API access from JavaScript/TypeScript, XML layouts, custom native wrappers, and cross-platform app deployment. Use when building truly native mobile apps without WebViews using JavaScript or TypeScript.

Original author description

Expert NativeScript assistance covering direct native API access from JavaScript/TypeScript, XML layouts, custom native wrappers, and cross-platform app deployment. Use when building truly native mobile apps without WebViews using JavaScript or TypeScript.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 164 lines, 599 words
SKILL.md preview
---
name: nativescript
description: Expert NativeScript assistance covering direct native API access from JavaScript/TypeScript, XML layouts, custom native wrappers, and cross-platform app deployment. Use when building truly native mobile apps without WebViews using JavaScript or TypeScript.
---

# NativeScript

NativeScript allows you to write native mobile apps using JavaScript/TypeScript, Angular, Vue, or Svelte. Unlike hybrid apps (WebView), it renders **native UI components** and provides **direct access** to all iOS and Android APIs without boilerplate wrappers.

## When to Use

- **Direct Native API Access**: Invoking 100% of native iOS (Objective-C/Swift) and Android (Java/Kotlin) APIs directly from TypeScript/JavaScript.
- **True Native Views without WebViews**: Building apps that render native UIKit/SwiftUI and Android View/Compose hierarchies without WebView overhead.
- **Familiar Web Framework Tooling**: Writing native mobile apps using modern Angular, Vue, React, or Svelte frameworks.
- **High-Performance Hardware Interop**: Interfacing directly with native device hardware libraries and third-party iOS CocoaPods or Android AARs.

## Quick Start

```bash
npm install -g nativescript
ns create my-app
# Choose flavor: Angular, Vue, React, Svelte, or TypeScript
cd my-app
ns run android
```

```typescript
// Accessing Native APIs directly (Android)
const time = new android.text.format.Time();
time.setToNow();
console.log(time.format("%d.%m.%Y"));
```

## Core Concepts

### Direct Native Runtime Bridge

NativeScript generates JavaScript runtime bindings for all platform APIs at compile time, allowing direct native instantiation:

```typescript
import { isIOS, isAndroid } from "@nativescript/core";

export function showNativeNotification(title: string, message: string) {
  if (isIOS) {
    const alert =
      UIAlertController.alertControllerWithTitleMessagePreferredStyle(
        title,
        message,
        UIAlertControllerStyle.Alert,
      );
    alert.addAction(
      UIAlertAction.actionWithTitleStyleHandler(
        "OK",
        UIAlertActionStyle.Default,
        null,
      ),
    );
    UIApplication.sharedApplication.keyWindow.rootViewController.presentViewControllerAnimatedCompletion(
      alert,
      true,
      null,
    );
  } else if (isAndroid) {
    const context = android.app.Application;
    android.widget.Toast.makeText(
      context,
      message,
      android.widget.Toast.LENGTH_SHORT,
    ).show();
  }
}
```

### Declarative Native Layout Containers

NativeScript layouts translate directly into native ViewGroup components:

```xml
<!-- app-main.xml -->
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo">
    <ActionBar title="Inventory Manager" class="action-bar" />
    <GridLayout rows="auto, *" columns="*">
        <SearchBar row="0" hint="Search items..." text="{{ searchQuery }}" />
        <ListView row="1" items="{{ inventoryItems }}">
            <ListView.itemTemplate>
                <StackLayout class="item-card">
                    <Label text="{{ name }}" class="item-title" />
                    <Label text="{{ stockCount }}" class="item-subtitle" />
                </StackLayout>
            </ListView.itemTemplate>
        </ListView>
    </GridLayout>
</Page>
```

### Native Plugin Integration via CocoaPods & Gradle

Seamlessly bundles third-party native libraries:

```ruby
# App_Resources/iOS/Podfile
pod 'Lottie', '~> 4.0'
```

## Common Patterns

### Platform-Specific Code Splitting

**Problem**: Writing distinct native implementations for iOS and Android without polluting UI files with runtime branching.

**Solution**:
Use file suffix convention (`.ios.ts` and `.android.ts`) or conditional platform checks:

```typescript
import { isAndroid, isIOS, Application } from "@nativescript/core";

export function showToast(message: string): void {
  if (isAndroid) {
    android.widget.Toast.makeText(
      Application.android.context,
      message,
      android.widget.Toast.LENGTH_SHORT,
    ).show();
  } else if (isIOS) {
    // Present native UIAlertController on root view controller
    const alert =
      UIAlertController.alertControllerWithTitleMessagePreferredStyle(
        null,
        message,
        UIAlertControllerStyle.Alert,
      );
    Application.ios.rootController.presentViewControllerAnimatedCompletion(
      alert,
      true,
      null,
    );
  }
}
```

## Best Practices

**Do**:

- Use Modern Framework Flavors: Prefer `@nativescript/angular` or `@nativescript/vue` for modern component architectures.
- Cache Native Object Lookups: Store repeated native references instead of constantly traversing the JS-to-native reflection bridge.
- Implement Virtualized Lists: Always use `ListView` or `CollectionView` rather than repeating items inside a `ScrollView`.
- Test on Physical Devices: Native bridge behavior and memory performance differ significantly between simulators and actual devices.

**Don't**:

- Use HTML/DOM APIs: There is no browser DOM in NativeScript; do not reference `document.getElementById` or `window`.
- Block the Native UI Thread: Offload heavy computational algorithms to background Web Workers.
- Ignore Platform Differences: Account for distinct iOS navigation controllers versus Android activity back-stack lifecycles.

## Troubleshooting

| Error               | Cause                                     | Solution                                                     |
| :------------------ | :---------------------------------------- | :----------------------------------------------------------- |
| `Marshalling Error` | Passing wrong type to native interaction. | Check native docs and cast types if needed.                  |
| `Out of Memory`     | Large images or memory leaks.             | Use `image-cache-it` or proper GC disposal management.       |
| `Build Failed`      | Native dependency issues.                 | `ns clean`, remove `platforms/` and `node_modules/`, re-run. |

## References

- [NativeScript Docs](https://docs.nativescript.org/)
- [NativeScript Plugins](https://market.nativescript.org/)

Versions

The database has no other skills named nativescript.

Database snapshot: 13.11.2026 · package version 3d1f26e31830 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100screenmap
    Generate a visual navigation map of an Expo / React Native or NativeScript app. Statically parses routes and links (expo-router, react-navigation, NativeScript Angular Router or Core XML pages, or your own parser) for full coverage, then deep-links through every screen in the…
  • 95react-native
    Cross-platform mobile development with React Native and Expo. Use when building iOS/Android apps with JavaScript/TypeScript, implementing native features, or optimizing mobile performance.
  • 100react-native-expert
    Expert in React Native, cross-platform mobile development, native modules, and performance optimization. Use when the user mentions mobile, JavaScript, TypeScript, cross platform, iOS, or Android, or when the task involves React Native Architecture, Component Types, Hooks Essentials, or Navigation.
  • 95native-sdk
    Discovery skill for the Native SDK, the complete toolkit for building native desktop applications. Apps are authored in TypeScript + declarative Native markup (.native) by default and compiled to native code with no JS runtime in the binary; Zig cores are an explicit…
  • 100javascript-typescript
    Professional JavaScript and TypeScript development skill covering modern ES6+, TypeScript, Node.js, Express, React, testing frameworks, and best practices. Use this skill when developing JavaScript/TypeScript applications, building React/Node.js projects, implementing RESTful…
  • 100eslint
    Expert ESLint assistance covering Flat Config (eslint.config.js), typescript-eslint, custom rules, and automated formatting. Use when enforcing code quality and preventing bugs in JavaScript/TypeScript.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.