rn-radio-button-group

1.0.2 • Public • Published

React Native Radio Buttons Group

Simple Radio Button Component for React Native - iOS and Android

npm LICENSE MIT

NPM

Getting Started

Let's see demo

DEMO

Installation

npm i rn-radio-button-group --save

or

yarn add rn-radio-button-group

Usage

<RadioGroup
    onValueChange={(value) => setLangValue(value)}
    selectedValue={langValue}
>
    <RadioButton
        value={"green"}
        style={{ marginBottom:10 }}
        size={27}
        color="green"
    >
        <Text style={{ marginLeft:10, fontSize:18 }} >Green</Text>
    </RadioButton>
    
    <RadioButton
        value={"red"}
        style={{ marginBottom:10 }}
        size={27}
        color="red"
    >
        <Text style={{ marginLeft:10, fontSize:18 }} >Red</Text>
    </RadioButton>
    
    <RadioButton
        value={"yellow"}
        style={{ marginBottom:10 }}
        size={27}
        color="yellow"
    >
        <Text style={{ marginLeft:10, fontSize:18 }} >Yellow</Text>
    </RadioButton>
    
    <RadioButton
        value={"orange"}
        style={{ marginBottom:10 }}
        size={27}
        color="orange"
    >
        <Text style={{ marginLeft:10, fontSize:18 }} >Orange</Text>
    </RadioButton>
</RadioGroup>

Props

RadioGroup

Key Type Required Default Valid Values
selectedValue string yes string
onValueChange function yes any function
children React.ReactNode no React.ReactNode

RadioButton

Key Type Required Default Valid Values
value string yes any string
disabled boolean no false true
onPress function no any function with paramter one accepting parameter (value)
color string no #900 any color codes
unCheckColor string no color value any string
size number no 24 any numeric value
thickness number no 1 any numeric value
style object no any StyleSheet Object
checked boolean no false true
children React.ReactNode no React.ReactNode

Contributions

Fork and create a pull request

License

MIT License

Package Sidebar

Install

npm i rn-radio-button-group

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

8.33 kB

Total Files

6

Last publish

Collaborators

  • sc.thakuri