- Syntax
- Usage
- Snippets
- Examples
- Demo
| Suffix | Description | Output |
|---|---|---|
-prop |
property | + all element properties |
-comp |
complete | + all element properties and events |
-snippet-[number] |
layout snippet | Layout snippets available in site docs |
| snippet | entered by user | output | description | |
|---|---|---|---|---|
| default | ns-button |
nsbutt |
<Button></Button> |
Plain tag |
| property (prop) | ns-button-prop |
nsbutpr |
with *props | + All properties |
| complete (comp) | ns-button-comp |
nsbu-c |
with *props, *events, *docs | + All properties, events and API docs |
| layout snippets | ns-dock-layout-snippet-2 |
nsdocnip2 |
see below | Sample snippets from [site docs]. |
| gestures | ns-tap |
nstap |
(tap)="" |
Gesture Snippets |
| setting icon | ns-icon-stop |
nsicost |
14 |
[Setting Icon] snippets |
<DockLayout width="210" height="210" backgroundColor="lightgray" stretchLastChild="true">
<Label text="left" dock="left" backgroundColor="red"></Label>
<Label text="top" dock="top" backgroundColor="green"></Label>
<Label text="right" dock="right" backgroundColor="blue"></Label>
<Label text="bottom" dock="bottom" backgroundColor="yellow"></Label>
</DockLayout><Button></Button><Button text=""></Button><Button
text="string"
(tap)=""
(loaded)=""
(unloaded)=""
(layoutChanged)="">
</Button>
<!--
Properties
NAME TYPE DESCRIPTION
text string Gets or sets the label of the button.
Events
NAME DESCRIPTION
tap Emitted when the button is tapped.
loaded Emitted when the view is loaded.
unloaded Emitted when the view is unloaded.
layoutChanged Emitted when the layout bounds of a view changes due to layout processing.
--><DockLayout width="210" height="210" backgroundColor="lightgray" stretchLastChild="true">
<Label text="left" dock="left" backgroundColor="red"></Label>
<Label text="top" dock="top" backgroundColor="green"></Label>
<Label text="right" dock="right" backgroundColor="blue"></Label>
<Label text="bottom" dock="bottom" backgroundColor="yellow"></Label>
</DockLayout>ns-absolute-layoutns-absolute-layout-snippet-1ns-absolute-layout-snippet-2ns-absolute-layout-compns-dock-layoutns-dock-layout-snippet-1ns-dock-layout-snippet-2ns-dock-layout-snippet-3ns-dock-layout-snippet-4ns-dock-layout-compns-grid-layoutns-grid-layout-snippet-1ns-grid-layout-snippet-2ns-grid-layout-snippet-3ns-grid-layout-snippet-4ns-grid-layout-snippet-5ns-grid-layout-snippet-6ns-grid-layout-compns-stack-layoutns-stack-layout-snippet-1ns-stack-layout-snippet-2ns-stack-layout-snippet-3ns-stack-layout-snippet-4ns-stack-layout-compns-wrap-layoutns-wrap-layout-snippet-1ns-wrap-layout-snippet-2ns-wrap-layout-snippet-3ns-wrap-layout-snippet-4ns-wrap-layout-compns-flexbox-layoutns-flexbox-layout-snippet-1ns-flexbox-layout-snippet-2ns-flexbox-layout-snippet-3ns-flexbox-layout-snippet-4ns-flexbox-layout-snippet-5ns-flexbox-layout-snippet-6ns-flexbox-layout-comp
ns-actionbarns-actionbar-compns-actionbarextensionns-actionitemns-actionitem-propns-actionitem-compns-navigationbuttonns-navigationbutton-propns-navigationbutton-compns-activityindicatorns-activityindicator-propns-activityindicator-compns-buttonns-button-propns-button-compns-datepickerns-datepicker-propns-datepicker-compns-formattedstringns-formattedstring-compns-htmlviewns-htmlview-compns-imagens-image-compns-labelns-label-propns-label-compns-listpickerns-listpicker-propns-listpicker-compns-listviewns-listview-propns-listview-compns-progressns-progress-compns-scroll-viewns-scroll-view-propns-scroll-view-compns-search-barns-search-bar-propns-search-bar-compns-segmented-barns-segmented-bar-propns-segmented-bar-compns-segmented-bar-itemns-sliderns-slider-compns-switchns-switch-propns-switch-compns-bottom-navigationns-bottom-navigation-propns-bottom-navigation-compns-tab-stripns-tab-strip-propns-tab-strip-compns-tab-strip-itemns-tab-strip-item-propns-tab-strip-item-compns-tab-content-itemns-tabsns-tabs-propns-tabs-compns-tab-viewns-tab-view-propns-tab-view-compns-tab-view-itemns-tab-view-item-compns-text-fieldns-text-field-propns-text-field-compns-text-viewns-text-view-propns-text-view-compns-time-pickerns-time-picker-propns-time-picker-compns-web-viewns-web-view-propns-web-view-comp
ns-tap→(tap)=""ns-doubleTap→(doubleTap)=""ns-longPress→(longPress)=""ns-swipe→(swipe)=""ns-pan→(pan)=""ns-pinch→(pinch)=""ns-rotation→(rotation)=""ns-touch→(touch)=""
ns-icon-done→0ns-icon-cancel→1ns-icon-edit→2ns-icon-save→3ns-icon-add→4ns-icon-flexibleSpace→5ns-icon-fixedSpace→6ns-icon-compose→7ns-icon-reply→8ns-icon-action→9ns-icon-organize→10ns-icon-bookmarks→11ns-icon-search→12ns-icon-refresh→13ns-icon-stop→14ns-icon-camera→15ns-icon-trash→16ns-icon-play→17ns-icon-pause→18ns-icon-rewind→19ns-icon-fastForward→20ns-icon-undo→21ns-icon-redo→22ns-icon-pageCurl→23
Reference: https://docs.nativescript.org/angular/ui/action-bar#setting-icons
Snippet: ns-datepicker
<BottomNavigation></BottomNavigation>Snippet: ns-datepicker-prop
<BottomNavigation
items="Array<TabContentItem>"
selectedIndex="number"
tabStrip="TabStrip">
</BottomNavigation>Snippet: ns-datepicker-comp
<BottomNavigation
items="Array<TabContentItem>"
selectedIndex="number"
tabStrip="TabStrip"
(selectedIndexChanged)=""
(loaded)=""
(unloaded)=""
(layoutChanged)="">
</BottomNavigation>
<!--
Properties
NAME TYPE DESCRIPTION
items Array<TabContentItem> Gets or sets the items of the BottomNavigation.
selectedIndex number Gets or sets the selectedIndex of the BottomNavigation.
tabStrip TabStrip Gets or sets the tab strip of the BottomNavigation.
Events
NAME DESCRIPTION
selectedIndexChanged Emitted when the selectedIndex property is changed.
loaded Emitted when the view is loaded.
unloaded Emitted when the view is unloaded.
layoutChanged Emitted when the layout bounds of a view changes due to layout processing.
-->Snippet: ns-absolute-layout
<AbsoluteLayout>
</AbsoluteLayout>Snippet: ns-absolute-layout-1
<AbsoluteLayout width="210" height="210" backgroundColor="lightgray">
<Label text="10, 10" left="10" top="10" width="90" height="90" backgroundColor="red"></Label>
<Label text="110, 10" left="110" top="10" width="90" height="90" backgroundColor="green"></Label>
<Label text="110, 110" left="110" top="110" width="90" height="90" backgroundColor="blue"></Label>
<Label text="10, 110" left="10" top="110" width="90" height="90" backgroundColor="yellow"></Label>
</AbsoluteLayout>Snippet: ns-absolute-layout-2
<AbsoluteLayout width="210" height="210" backgroundColor="lightgray">
<Label text="no margin" left="10" top="10" width="100" height="100" backgroundColor="red"></Label>
<Label text="margin=`30`" left="10" top="10" margin="30" width="100" height="90" backgroundColor="green"></Label>
</AbsoluteLayout>Snippet: ns-absolute-layout-comp
<AbsoluteLayout>
</AbsoluteLayout>
<!--
AbsoluteLayout Properties
None.
AbsoluteLayout Child Properties
PROPERTY DESCRIPTION
left Gets or sets the distance, in pixels, between the left edge of the child and the left edge of its parent AbsoluteLayout client area.
top Gets or sets the distance, in pixels, between the top edge of the child and the top edge of its parent AbsoluteLayout client area.
-->
