
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
react-native-radio-btn
Advanced tools
Fork of: react-native-flexi-radio-button
npm i react-native-radio-btn
or
yarn add react-native-radio-btn
import {RadioGroup, RadioButton} from 'react-native-radio-btn'
state = {
radioItems: [
{
id: 1,
label: 'Item 1',
selected: false,
},
{
id: 2,
label: 'Item 2',
selected: false,
},
{
id: 3,
label: 'Item 3',
selected: false,
},
],
};
onSelect(index, value) {
console.log(`Selected index: ${index} , value: ${value}`);
}
render(){
return(
<View style={styles.container}>
<RadioGroup onSelect={(index, value) => this.onSelect(index, value)}>
{this.state.radioItems.map((item, index) => {
return (
<RadioButton
key={index}
value={item.label}
displayText={item.label}
displayTextColor="#000"
displayTextActiveColor="#fff"
prefixColor="rgba(0, 0, 0, 0.4)"
prefixActiveColor="rgba(0, 0, 0, 0.4)"
prefixWithNumbers
/>
);
})}
</RadioGroup>
</View>
)
}
Property | Type | Default | Description |
---|---|---|---|
size | number | 20 | Size of the radio button |
thickness | number | 1 | width of radio button border |
color | string | '#007AFF' | color of radio button |
activeColor | string | null | color of radio button when selected |
highlightColor | string | null | background of radio button after selected |
selectedIndex | number | null | default selected index of radio group, can be changed to new value or to null for clear selection |
style | object | null | Custom styles to be applied if supplied |
onSelect | function(index, value) | null | function to be invoked when radio button is selected |
Property | Type | Default | Description |
---|---|---|---|
value | any | null | value will be passed on callback onSelect as second argument |
style | object | null | Styles to be applied on 'RadioButton' component |
color | string | same as 'RadioGroup' component | color of radio dot |
disabled | bool | false | If true, disable all interactions for this component. |
displayTextColor | string | '#000' | color of label text |
displayTextActiveColor | string | '#fff' | color of label text when selected |
prefixColor | string | '#000' | color of prefixes |
prefixActiveColor | string | '#fff' | color of prefixes when selected |
prefixWithAlphabet | boolean | false | prefixes label with alphabets (a,b,...z) |
prefixWithNumbers | boolean | false | prefixes label with numbers (1,2...n) |
FAQs
Custom Radio button component for React Native
The npm package react-native-radio-btn receives a total of 8 weekly downloads. As such, react-native-radio-btn popularity was classified as not popular.
We found that react-native-radio-btn 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.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.