Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@msaelices/nativescript-radiobutton

msaelices8Apache 2.00.3.0TypeScript support: included

A plugin for nativescript that exposes the radiogroup and radiobutton native view elements.

NativeScript, JavaScript, Android

readme

NativeScript-RadioButton

npm npm

A NativeScript plugin for the native radiogroup and radiobutton widget.

Platform controls used:

Android iOS
Android RadioGroup NONE
Android RadioButton NONE

Installation

From your command prompt/terminal go to your app's root folder and execute:

tns plugin add nativescript-radiobutton

Useage

Angular

Import to NgModule for use

import { RadioButtonModule } from 'nativescript-radiobutton/angular'

@NgModule({
    imports: [
        RadioButtonModule
    ]
})

Place this in your view.

<StackLayout>
    <RadioGroup [(value)]="dataBoundVariable">
        <RadioButton text="Selection 1"></RadioButton>
        <RadioButton text="Selection 2"></RadioButton>
        <RadioButton text="Selection 3"></RadioButton>
    </RadioGroup>
</StackLayout>

Supported Properties

RadioButton

Android Example
enabled enabled="true | false"
text text="a string"
checked checked="true | false"

RadioGroup

Android Returns
value the index of the radio button selected

Supported Events

RadioButton

Android Example
enabled enabled="true | false"
text text="a string"
checked checked="true | false"

RadioGroup

Android Type
value EventEmitter<number>