Skip to content
NativeScript Unified

NativeScript views

Button and TextField

The web-polyfills package has no <Button> or <TextField> component. The full list of tags it implements is:

ActionBar, NavigationButton, Tabs, Pager, Drawer, GridLayout, StackLayout, WrapLayout, AbsoluteLayout, DockLayout, FlexboxLayout, SplitView, ContentView, ScrollView, ActivityIndicator, Progress, Switch, Slider, SearchBar, SegmentedBar, ListPicker, Label, FormattedString, Span (also as NSpan), Placeholder, Image, DatePicker, TimePicker, HtmlView, ListView, Repeater and WebView.

In an HTML-first app you use the HTML elements for those two, styled with Spartan helm. See the HTML-first equivalent below.

On a device, <button> and <input> are native views. Taps fire (click), and the input takes typed text. Native status lists the remaining gaps.

HtmlView and ContentView

<HtmlView html="..."> renders an HTML string through [innerHTML], and selectable allows text selection. <ContentView> projects its content into a column. Page and Frame are not registered. See Polyfill limitations.

Bold and italic from an HTML string

HTML-first equivalent

<Button text="Save"> is <button hlmBtn>Save</button>, and <TextField hint="Email"> is <input hlmInput placeholder="Email" />:

See Button and Form controls for every variant.