Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
rn-radio-button
Advanced tools
Simple Radio Button Component for React Native - iOS and Android
simple and useful radio button component for React Native
npm i rn-radio-button --save
import React, { useState } from "react";
import { SafeAreaView, Text, View } from "react-native";
import RadioButton from "rn-radio-button";
const App = () => {
console.log(RadioButton);
const [val, setVal] = useState("-");
function pressCircle(i) {
setVal(i);
}
return (
<>
<SafeAreaView style={{ backgroundColor: "#085b7c", flex: 0 }} />
<SafeAreaView style={{ flex: 1, marginHorizontal: 10 }}>
<RadioButton
outerWidth={30}
innerWidth={20}
borderWidth={1}
data={listData}
color={"steelblue"}
onPress={pressCircle}
wrapperStyle={{ padding: 3 }}
/>
<View
style={{
marginHorizontal: 10,
marginVertical: 10,
alignItems: "center"
}}
>
<Text>{"clicked item value is: " + val}</Text>
</View>
</SafeAreaView>
</>
);
};
const listData = [
{ label: "First", value: 1 },
{ label: "Second", value: 2 },
{ label: "Fifth", value: 5 },
{ label: "Sixth", value: 6 }
];
export default App;
<RadioButton
data={listData}
color={"steelblue"}
onPress={val => console.log(val)}
wrapperStyle={{ padding: 3 }}
/>
<RadioButton
data={listData}
outerWidth={30}
innerWidth={20}
borderWidth={1}
color={"steelblue"}
onPress={val => console.log(val)}
wrapperStyle={{ padding: 3 }}
/>
Property | Type | Default | Description |
---|---|---|---|
data | array of objects | [] | Required |
outerWidth | integer | 20 | define width of outer Circle ( optional ) |
innerWidth | integer | 10 | defined Width of inner Circle ( optional) |
borderWidth | integer | 1 | define borderWidth of outer Circle |
color | string | 'steelblue' | Define primary color for inner and outer Circle |
onPress | function | - | Define function for get value of selected radio button |
wrapperStyle | Object style | - | Styling for wrap outer side of Radio Button |
horizontal | boolean | false | make list of radio Button wrap Horizontally |
- cd ExampleApp/ && npm install
- cd ios && pod install
- cd .. && react-native run-ios
FAQs
Simple and customizable React Native Radio Button
We found that rn-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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.