Socket
Socket
Sign inDemoInstall

react-native-custom-radio-group

Package Overview
Dependencies
4
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-custom-radio-group

React native radio group with custom component


Version published
Weekly downloads
47
increased by34.29%
Maintainers
1
Install size
348 kB
Created
Weekly downloads
 

Readme

Source

react-native-custom-radio-group

A react native radio group component with custom radio button. The component enables single select radio button behaviour with default select option and customization of the button styles.

Example:
Example uses default styles by RadioGroup

Demo gif

Installation:

npm install react-native-custom-radio-group --save

Props:

  • radioGroupList (Required) : An array of object; object => {label: '', value: ''}
  • onChange: CallBack with the value of selected radio button
  • initialValue: Value of the option to be initially selected
  • containerStyle: Style of the radio group container
  • buttonContainerStyle: Base style of the custom button container,
  • buttonTextStyle: Base style of the custom button label text,
  • buttonContainerActiveStyle: Added style of the custom button container when active,
  • buttonContainerInactiveStyle: Added style of the custom button container when inactive,
  • buttonTextActiveStyle: Added style of the custom button text when active,
  • buttonTextInactiveStyle: Added style of the custom button text when inactive

Usage:

import React, {Component} from 'react';
import {View, Text} from 'react-native';
import RadioGroup from 'react-native-custom-radio-group';
import {radioGroupList} from './radioGroupList.js'

export default class MyComponent extends Component {
  render () {
    return (
      <View>
        <Text> SELECT: </Text>
        <RadioGroup radioGroupList={radioGroupList}/>
      </View>);
  }
}


//radioGroupList.js
export const radioGroupList = [{
  label: 'Car',
  value: 'transport_car'
}, {
  label: 'Bike',
  value: 'transport_bike'
}, {
  label: 'Bus',
  value: 'transport_bus'
}];

Keywords

FAQs

Last updated on 17 Feb 2018

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