1.0.2 • Published 2 years ago

rn-radio-button-group v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

KeyTypeRequiredDefaultValid Values
selectedValuestringyesstring
onValueChangefunctionyesany function
childrenReact.ReactNodenoReact.ReactNode

RadioButton

KeyTypeRequiredDefaultValid Values
valuestringyesany string
disabledbooleannofalsetruefalse
onPressfunctionnoany function with paramter one accepting parameter (value)
colorstringno#900any color codes
unCheckColorstringnocolor valueany string
sizenumberno24any numeric value
thicknessnumberno1any numeric value
styleobjectnoany StyleSheet Object
checkedbooleannofalsetruefalse
childrenReact.ReactNodenoReact.ReactNode

Contributions

Fork and create a pull request

License

MIT License