Socket
Socket
Sign inDemoInstall

react-native-customizable-radio-button

Package Overview
Dependencies
514
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-customizable-radio-button

A simple and (almost) fully customizable React-Native RadioButton component.


Version published
Weekly downloads
10
decreased by-75%
Maintainers
1
Install size
524 kB
Created
Weekly downloads
 

Readme

Source

npm npm

About

This is a React-Native RadioButton component that you can freely modify its styles.

Instalation

To install just input the following command:

npm i react-native-customizable-radio-button

or

yarn add react-native-customizable-radio-button

Basic Usage

//...
import RadioButton from 'react-native-customizable-radio-button';

const options = [
  {
    id: 1, // required
    text: 'Most High Pay', //required
  },
  {
    id: 2,
    text: 'Most Perfomance',
  },
];

export default class reactNativeRadioButtonForm extends Component {

  onValueChange = item => {
    console.log(item);
  };

  render() {
    return (
      <RadioButton
        data={options} //required
        onValueChange={this.onValueChange.bind(this)} //required
      />
    );
  }
}

Advanced Usage

//...
import RadioButton from 'react-native-customizable-radio-button';

const options = [
  {
    id: 1, // required
    text: 'Most High Pay', //required
  },
  {
    id: 2,
    text: 'Most Perfomance',
  },
];

export default class reactNativeRadioButtonForm extends Component {

  onValueChange = item => {
    console.log(item);
  };

  render() {
    return (
      <RadioButton
        // defaultOption={id} // you may input the selected option as default. When not marked, first is always selected
        // formStyle = {{}} // add your styles to whole form container
        // containerStyle={{}} // add your styles to each item container
        // circleContainerStyle={{}} // add your styles to each outer circle
        // innerCircleStyle={{}} // add your styles to each inner circle
        // labelStyle={{}} // add your styles to each label
        // isContainerClickable={false} // default false, when true whole item container changes value
        data={options} //required
        onValueChange={this.onValueChange.bind(this)} //required
      />
    );
  }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Keywords

FAQs

Last updated on 06 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc