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
Name | Type | Description |
---|---|---|
text | string | Sets the label of the button. |
textWrap | boolean | Sets whether the widget wraps the text of the label. Useful for longer labels. Default value is false . |
onTap | (args: EventData ) => void | Emitted when the Button is tapped. |
Native component
Android | iOS |
---|---|
android.widget.Button | UIButton |