Skip to content
NativeScript Unified

Getting started

Introduction

nativescript-unified is an Nx monorepo for building NativeScript Angular apps the HTML-first way. You write pages as ordinary HTML (<div>, <p>, <h1>, <ul>, <a href>), lay them out with CSS flex and grid, style them with Tailwind classes, and build richer UI from Spartan helm components. The same template runs in two places:

  • In a browser, through an AnalogJS app built with Vite. This site is that app.
  • On a device, as real native views. MasonKit registers HTML-shaped elements with @nativescript/angular. Each one is a native view, not a web view, and Mason, a Rust layout engine built on taffy, lays them out with CSS flex, grid and block flow.
HTML first

Plain elements, flex, Tailwind and a helm card.

Spartan

Every live demo in these docs is the code shown in its Code tab, compiled at run time against the components in this workspace: in your browser on the web, and on the device in the native app. Nothing is mocked.

How the pieces fit

Web and native diverge often, so they are separate apps at the top of the workspace. Each owns its own pages and its own core (providers, bootstrap, platform setup). Everything both can use lives underneath:

LayerWhereWhat it holds
Webapps/webAnalogJS app: pages/, web providers
Nativeapps/nativeNativeScript Angular app: pages/, native bootstrap
Sharedpackages/sharedHTML-first components, example screens and the Markdown for these docs
UIpackages/uiSpartan brain (headless) and helm (styled) components, the theme tokens and the NativeScript glue

Project structure has the full map, and Web vs native explains how to decide where code goes.

Where to start

  1. Installation: install the workspace and run both apps.
  2. Project structure and Web vs native: what lives where.
  3. HTML first, then Layout with flex and grid and Theming: how pages are written.
  4. Components: live Spartan helm examples, and what each one does on native.
  5. File-based routing and Markdown content on native: pages and content on both platforms.

Short answers to common questions are in the FAQ.

NativeScript views

NativeScript apps are often written with tags such as <StackLayout> and <Label>. The web-polyfills package implements those tags as Angular components so an existing NativeScript tree also renders in a browser. New pages are HTML first, and the tags have their own section: NativeScript views.

Platforms

The targets are the web, iOS and Android.

The web app builds and prerenders this site. The native app renders these same docs pages with their live demos on the device. Native status records what each component does there, and the limits that apply to every component are in Known native limitations.