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

Button

<Button> is a UI component that displays a button which reacts to a user gesture.

See also:

  • Official top-level documentation
  • Detailed API specification
  • Official top-level documentation for Gestures

import * as React from "react";
import { EventData } from "@nativescript/core";

<button
  text="Button"
  onTap={(args: EventData) => {
    const button = args.object;
  }}
/>

Props

NameTypeDescription
textstringSets the label of the button.
textWrapbooleanSets whether the widget wraps the text of the label. Useful for longer labels. Default value is false.
onTap(args:EventData) => voidEmitted when the Button is tapped.

Native component

AndroidiOS
android.widget.ButtonUIButton
Last updated by Jamie Birch
← ActionItemDatePicker →
  • Props
  • 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