Skip to content
NativeScript Unified

Getting started

FAQ

Which platforms does it run on?

The web, iOS and Android. The native app renders these docs pages with their live demos on the device. See Installation and Web vs native.

Why are web and native separate apps?

Web and native run on different form factors and handle flows and interactions differently. Each app designs its pages and flows for its own platform, and shared HTML sits underneath both. See Why they diverge.

Why not use the AnalogJS packages on native?

The AnalogJS router calls plain provideRouter, so it misses the NativeScript location strategy and RouterExtensions. AnalogJS content renders to an HTML string that a native view cannot show. And adding @analogjs/platform would register the Angular compiler twice and pull in Nitro and SSR. Native keeps Analog's file conventions with its own implementation.

Can I write <StackLayout> on the web?

Yes, if you import the component, and the web polyfills draw it. HTML-first pages use HTML instead. See HTML first, StackLayout and Polyfill limitations.

Why are the polyfills not custom elements?

A custom element name needs a hyphen, and StackLayout has none.

Can I use <Button> or <TextField>?

Not through the polyfills. Use HTML elements or Spartan. On a device <Button> is MasonKit's button. NativeScript's core Button stays available as <NButton>. See Button, Form controls and Button and TextField.

Can a demo react to input?

Yes. A demo is a real Angular template, so a template reference gives you the component instance. Toggle this switch:

Off

Does px mean the same thing on native?

On MasonKit elements, yes: px is a CSS pixel, the same size as a NativeScript dip, and rem, em, vw, vh and calc() resolve as they do in a browser. On core NativeScript views such as Label or ActionBar, px is a device pixel. A bare number means a dip on both. See Writing shared HTML features.

How do I add a docs page?

Add a .md file to packages/shared/content/docs. The slug is the file name. Front matter has title, section, order and description. Pages sort by order, then by title, and sections appear in the order of their first page. A fenced block tagged html live is both shown and rendered as a demo. Tag it html live mason to preview it with MasonKit's form controls in the app instead of platform widgets, or html live web when it uses markup that only the web polyfills understand. See Native elements. Both apps pick the file up: the web prerenders it at /docs/<slug>, and the native app lists it on its Guide or Components tab.

Is the site prerendered?

Yes. nx build web writes static HTML for the home page and every docs page. Demos compile in the browser, and the Angular compiler loads on demand.

Where do the colours come from?

packages/ui/styles/tokens.css. See Theming.

Can I rename the package scope?

The scope @nativescript-unified is a placeholder. Renaming means changing the package names and the paths in tsconfig.base.json.