React NativeScript

React NativeScript

  • Docs

›ELEMENTS: COMPONENTS

INTRODUCTION

  • Introduction

GETTING STARTED

  • Quick Start
  • Environment Setup
  • Using React Devtools

CORE CONCEPTS

  • Native Access
  • Navigation
  • Node Roles
  • Modals
  • Plugins
  • Styling

SAMPLES

  • Apps

ELEMENTS: LAYOUT

  • AbsoluteLayout
  • DockLayout
  • FlexboxLayout
  • GridLayout
  • StackLayout
  • WrapLayout

ELEMENTS: COMPONENTS

  • ActivityIndicator
  • ActionBar
  • ActionItem
  • Button
  • DatePicker
  • Frame
  • HtmlView
  • Image
  • Label
  • ListView
  • ListPicker
  • NavigationButton
  • Page
  • Placeholder
  • Progress
  • ScrollView
  • SearchBar
  • SegmentedBar
  • Slider
  • Switch
  • TabView
  • TabViewItem
  • TextField
  • TextView
  • TimePicker
  • WebView

LICENCES

  • Licences
Edit

Frame

<frame> is a UI component used to display <page> elements. Every app needs at least a single <frame> element, usually set as the root element.

See also:

  • Official top-level documentation
  • Detailed API specification

A frame with a default page

import * as React from "react";

function AppContainer(){
  return (
    <frame>
      <page>
        <actionBar title="Default Page Title" />
        <gridLayout>
          <label text="Default Page Content" />
        </gridLayout>
      </page>
    </frame>
  );
}

A frame with a default page from an external component

import * as React from "react";
import HomePage from './HomePage';

<frame>
  <HomePage />
</frame>

Multiple Frames

If you need to create multiple frames, you can do so by wrapping them in a Layout, for example if you want to have 2 frames side-by-side:

import * as React from "react";

<gridLayout columns={"* *"} rows={[]}>
  <frame col={0}/>
  <frame col={1}/>
</gridLayout>

Native component

AndroidiOS
org.nativescript.widgets.ContentLayoutUINavigationController
Last updated by Jamie Birch
← DatePickerHtmlView →
  • Native component
React NativeScript
Docs
Getting StartedUI Components Reference
Community
Stack OverflowChat on Slack in #reactTwitter
More
GitHub – React NativeScriptGitHub – Docs Site
Copyright © 2021 Jamie Birch