Gathering detailed insights and metrics for react-native-simple-radio-button
Gathering detailed insights and metrics for react-native-simple-radio-button
Gathering detailed insights and metrics for react-native-simple-radio-button
Gathering detailed insights and metrics for react-native-simple-radio-button
@types/react-native-simple-radio-button
TypeScript definitions for react-native-simple-radio-button
react-native-radio-buttons-group
Simple and Best. An easy to use radio buttons for react native apps.
@material/radio
The Material Components for the web radio component
@radix-ui/react-radio-group
npm install react-native-simple-radio-button
99.8
Supply Chain
100
Quality
76
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
453 Stars
161 Commits
130 Forks
13 Watching
10 Branches
22 Contributors
Updated on 11 Aug 2024
JavaScript (74.45%)
Objective-C (15.06%)
Python (5.92%)
Java (4.57%)
Cumulative downloads
Total Downloads
Last day
-1.9%
10,345
Compared to previous day
Last week
40.6%
69,181
Compared to previous week
Last month
-4.9%
222,831
Compared to previous month
Last year
78.6%
2,827,177
Compared to previous year
No dependencies detected.
simple and useful radio button component for React Native
in Cli
1npm i react-native-simple-radio-button --save
1import RadioForm, {RadioButton, RadioButtonInput, RadioButtonLabel} from 'react-native-simple-radio-button'; 2 3 4var radio_props = [ 5 {label: 'param1', value: 0 }, 6 {label: 'param2', value: 1 } 7]; 8 9var RadioButtonProject = React.createClass({ 10 getInitialState: function() { 11 return { 12 value: 0, 13 } 14 }, 15 render: function() { 16 return ( 17 <View> 18 <RadioForm 19 radio_props={radio_props} 20 initial={0} 21 onPress={(value) => {this.setState({value:value})}} 22 /> 23 </View> 24 ); 25 } 26});
1<RadioForm 2 radio_props={radio_props} 3 initial={0} 4 onPress={(value) => {this.setState({value:value})}} 5/>
1<RadioForm 2 radio_props={this.state.types} 3 initial={0} 4 formHorizontal={false} 5 labelHorizontal={true} 6 buttonColor={'#2196f3'} 7 animation={true} 8 onPress={(value) => {this.setState({value:value})}} 9/>
1<RadioForm 2 formHorizontal={true} 3 animation={true} 4> 5 {/* To create radio buttons, loop through your array of options */} 6 { 7 radio_props.map((obj, i) => ( 8 <RadioButton labelHorizontal={true} key={i} > 9 {/* You can set RadioButtonLabel before RadioButtonInput */} 10 <RadioButtonInput 11 obj={obj} 12 index={i} 13 isSelected={this.state.value3Index === i} 14 onPress={onPress} 15 borderWidth={1} 16 buttonInnerColor={'#e74c3c'} 17 buttonOuterColor={this.state.value3Index === i ? '#2196f3' : '#000'} 18 buttonSize={40} 19 buttonOuterSize={80} 20 buttonStyle={{}} 21 buttonWrapStyle={{marginLeft: 10}} 22 /> 23 <RadioButtonLabel 24 obj={obj} 25 index={i} 26 labelHorizontal={true} 27 onPress={onPress} 28 labelStyle={{fontSize: 20, color: '#2ecc71'}} 29 labelWrapStyle={{}} 30 /> 31 </RadioButton> 32 )) 33 } 34</RadioForm>
Updating active radio button forcibly
[]
) *requiredradio button value and label array
callback when radio button clicked.
0
)The index of selected radio button. This is used when this component is activated. If you want to pass initial as asynchronous, you can use updateIsActiveIndex function.
If you want to make it empty initially, please pass
-1
change radio button color
1<RadioForm 2 radio_props={radio_props} 3 initial={0} 4 buttonColor={'#50C900'} 5/>
change label color
1<RadioForm 2 radio_props={radio_props} 3 initial={0} 4 labelColor={'#50C900'} 5/>
change form position
1<RadioForm 2 radio_props={radio_props} 3 initial={0} 4 formHorizontal={true} 5/>
change label position
1<RadioForm 2 radio_props={radio_props} 3 initial={0} 4 labelHorizontal={false} 5/>
true
)if you pass false, animation of radio button is disabled
indicates accessibility for the individual radio button input and radio button label components
used to set accessibilityLabel for individual radio button input and radio button label components, radio button input will have accessibilityLabel = [accessibilityLabel]Input[index] radio button label will have accessibilityLabel = [accessibilityLabel]Label[index]
used to set testID for individual radio button input and radio button label components, radio button input will have testID = [testID]Input[index] radio button label will have testID = [testID]Label[index]
If you pass true
to this param, that button change to selected status.
change label position to horizontal
The button color
The selected button color
The label color
The label style
Styles that are applied to the
callback when radio button clicked.
|
)separator used for extracting id from accessibilityLabel and testID
indicates accessibility for the wrapped radio button input and radio button label components
used to set accessibilityLabel for the wrapped radio button input and radio button label components, needs to be of the format [accessibilityLabel][separator][id] radio button input will have accessibilityLabel = [accessibilityLabel]Input[index] radio button label will have accessibilityLabel = [accessibilityLabel]Label[index]
used to set testID for individual radio button input and radio button label components, needs to be of the format [testID][separator][id] radio button input will have testID = [testID]Input[index] radio button label will have testID = [testID]Label[index]
1<RadioButton 2 accessible={true} 3 idSeparator=',' 4 accessibilityLabel='noteType,1' 5 testID='noteType,1' 6/>
The button inner color
The button inner color
The button size. Width and height will be same length.
The button size of outer. Width and height will be same length.
Custom button style
Custom style for view of button's outside
indicates accessibility for the radio button input component
used to set accessibilityLabel (content description / label for Android) for the radio button input component
used to set testID (id / name for iOS) for the radio button input component
If you pass true, the button and label will be aligned horizontally.
If you pass style, you can change label text style as you want
If you pass style, you can change label wrapper view style as you want
callback when radio button clicked.
indicates accessibility for the radio button label component
used to set accessibilityLabel (content description / label for Android) for the radio button label component
used to set testID (id / name for iOS) for the radio button label component
Of course! Welcome :)
You can use following command in example
dir:
npm run sync
During running this command, when you change source to implement/fix something, these changes will sync to example/node_modules/react-native-simple-radio-button/
. You can check your change using example project easily.
MIT
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 10/19 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
83 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More