0.2.7 • Published 5 years ago

@webileapps/nativescript-radiobutton v0.2.7

Weekly downloads
6
License
Apache 2.0
Repository
github
Last release
5 years ago

NativeScript-RadioButton

This is a fork of other NativeScript plugin for the native radiogroup and radiobutton widget.

Changes from the original plugin

  • Support for tintColor xml property ( or tint-color css property).
  • Make color xml (and css property) work correctly.

Platform controls used:

AndroidiOS
Android RadioGroupNONE
Android RadioButtonNONE

Installation

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

tns plugin add @webileapps/nativescript-radiobutton

Usage

Demo App

If you want a quickstart, clone the repo, cd src, and execute the following commands:

npm install
npm run demo.android

Angular

Import to NgModule for use

import { RadioButtonModule } from '@webileapps/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>

NativeScript-Vue

In your main.js register both RadioGroup and RadioButton elements

Vue.registerElement('RadioGroup', () => require('@webileapps/nativescript-radiobutton').RadioGroup)
Vue.registerElement('RadioButton', () => require('@webileapps/nativescript-radiobutton').RadioButton)

And in your template, use it

<RadioGroup
  @selected="onSelected">
  <RadioButton
    v-for="item in someList"
    :key="item.id"
    :text="item.text">
  </RadioButton>
</RadioGroup>

Supported Properties

RadioButton

AndroidExample
enabledenabled="true | false"
texttext="a string"
checkedchecked="true | false"

RadioGroup

AndroidReturns
valuethe index of the radio button selected

Supported Events

RadioGroup

AndroidType
valueEventEmitter
0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago