Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-native-custom-radio-button
Advanced tools
Readme
Simple and animated radio button component for React Native
npm i react-native-custom-radio-button --save
import {RadioGroup, RadioButton} from 'react-native-custom-radio-button'
onSelect(index, value){
this.setState({
text: `${value}`
})
}
render(){
return(
<View style={styles.container}>
<RadioGroup
onSelect = {(index, value) => this.onSelect(index, value)}
>
<RadioButton value={'React native'}>
<Text style={styles.title}>React native</Text>
</RadioButton>
<RadioButton value={'Javascript'}>
<Text style={styles.title}>Javascript</Text>
</RadioButton>
<RadioButton value={'Flexbox'}>
<Text style={styles.title}>Flexbox</Text>
</RadioButton>
</RadioGroup>
<Text style={styles.text}>{this.state.text}</Text>
</View>
)
}
<RadioGroup
size={24}
thickness={2}
selectedIndex={1}
onSelect = {(index, value) => this.onSelect(index, value)}
>
<RadioButton
value='Red color'
color='red'>
<Text style={styles.title}>Red color</Text>
</RadioButton>
<RadioButton
value='Green color'
color='green'>
<Text style={styles.title}>Green color</Text>
</RadioButton>
<RadioButton
value='Blue color'
color='blue'>
<Text style={styles.title}>Blue color</Text>
</RadioButton>
</RadioGroup>
Property | Type | Default | Description |
---|---|---|---|
size | number | 20 | radio button size |
thickness | number | 1 | radio button border width |
color | string | '#007AFF' | radio button color |
highlightColor | string | null | selected radio button background |
selectedIndex | number | null | default selected index of radio group |
onSelect | function(index, value) | null | function to be invoked when radio button is selected |
Of course! Welcome :)
You can use following command in example
dir:
FAQs
custom radio button for react native apps
The npm package react-native-custom-radio-button receives a total of 34 weekly downloads. As such, react-native-custom-radio-button popularity was classified as not popular.
We found that react-native-custom-radio-button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.