npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-simple-radio-buttons

v1.1.1

Published

React Native simple radio buttons is small size but bried package

Downloads

10

Readme

react-native-simple-radio-buttons

React Native simple radio buttons is small size but brief and easy to use package. You can use with default properties and even you can fully customise with your requirements.

Authors

Badges

Version Version

Installation

Install react-native-simple-radio-buttons with npm or yarn

npm i react-native-simple-radio-buttons

Or

yarn add react-native-simple-radio-buttons

Props

| Props | type | description | | ----------------- | ------------------------------------------------------------------ | ------------| | items | [{}] | this array of objects will contain details for radio buttons, e.g. [{label: 'Male', 'male'},{label: 'female', 'female'}] | | value | string | this will be the selected radio button, if you want to show initially unselected all, then initialize will empty string etc | setValue | useState | used to update the value | | withLabels | boolean | show labels with radio button, e.g. true, to show labels| | buttonOuterColor | color | default color is black, pass your required color| | buttonOuterSize | integer | size for radio button outer, e.g. 30,35 | | defaultButtonColor | color | unselected radio button color property, default color is black, if you described the buttonOuterColor, than this will be buttonOuterColor, else you can specify with your required color| | buttonInnerColor | color | default color is black, pass your required color| | buttonInnerSize | integer |size for radio button inner, e.g. 25,30 | | radioFormStyle | ViewStyleProps | you can fully customize using radioFormStyle, e.g. flexDirection: 'row' see examples| | radioButtonItemStyle | ViewStyleProps | custom style for each radio buttom item, e.g. each row or each column.| | radioButtonLabelStyle | TextStyleProps | custome style for radio button labels, e.g. fontSize, color etc.| | onPress | function | if you want to perform some extra task on each radio button select, you can define the onPress|

Usage/Examples

import RadioForm from 'react-native-simple-radio-buttons';

function App() {
  const [value, setValue] = useState("")
  const [items,setItems] = useState([
    {label: 'test1', value: 'test1'},
    ...,
    {label: 'test8', value: 'test8'}
  ])
  return (
    <RadioForm
      items={items} 
      value={value} 
      setValue={setValue}
      withLabels={true}
   />
   )
}

Output

App Screenshot

Usage/Examples

import RadioForm from 'react-native-simple-radio-buttons';

function App() {
  const [value, setValue] = useState("")
  const [items,setItems] = useState([
    {label: 'test1', value: 'test1'},
    ...,
    {label: 'test8', value: 'test8'}
  ])
  return (
    <RadioForm
        items={items}
        value={value}
        setValue={setValue}
        withLabels={true}
        buttonOuterColor={'#008AD8'}
        defaultButtonColor={'#00000050'}
        buttonOuterSize={30}
        buttonInnerColor={'#008AD8'}
        buttonInnerSize={25}
        radioFormStyle={{ flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between' }}
        radioButtonItemStyle={{
          backgroundColor: '#d3d3d3',
          width: 80,
          marginBottom: 10,
        }}
        radioButtonLabelStyle={{
          fontSize: 16,
          color: '#008AD8'
        }}
        onPress={() => {
          console.log("clicked!")
        }}
   />
   )
}
 <RadioForm
        items={items}
        value={value}
        setValue={setValue}
        withLabels={true}
        buttonOuterColor={'#008AD8'}
        defaultButtonColor={'#00000050'}
        buttonOuterSize={30}
        buttonInnerColor={'#008AD8'}
        buttonInnerSize={25}
        radioFormStyle={{ flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between' }}
        radioButtonItemStyle={{
          backgroundColor: '#d3d3d3',
          width: 80,
          marginBottom: 10,
          flexDirection: 'column'
        }}
        radioButtonLabelStyle={{
          fontSize: 16,
          color: '#008AD8'
        }}
        onPress={() => {
          console.log("clicked!")
        }}

      />
  items={items}
        value={value}
        setValue={setValue}
        withLabels={true}
        buttonOuterColor={'#008AD8'}
        defaultButtonColor={'#00000050'}
        buttonOuterSize={30}
        buttonInnerColor={'#008AD8'}
        buttonInnerSize={25}
        radioFormStyle={{ flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between' }}
        radioButtonItemStyle={{
          backgroundColor: '#d3d3d3',
          width: 190,
          marginBottom: 10,
        }}
        radioButtonLabelStyle={{
          fontSize: 16,
          color: '#008AD8'
        }}
        onPress={() => {
          console.log("clicked!")
        }}

      />

License

MIT

Support

For support, follow me on LinkedIn [https://www.linkedin.com/in/arif-yousaf-mauk-19a548166/] or github.