Easy and simple to use Radio Buttons for your React Native Application.

Overview

React Native Simple Radio Buttons

Easy and simple to use Radio Buttons for your React Native Application.

Installation

npm i react-native-custom-radio-buttons

Components

  • RadioButtons
    • Container to create a radio button.

Props

  • text: Accepts string to show as option in Radio Button
  • setOption: Callback to change selected option
  • selected: Set which option is selected

Optional Props

  • radioButtonBorderColor: Set the Radio Button Oultine Color (Default: #000)
  • radioButtonSize: Sets the size of the radio button (Default: 20)
  • selectedRadioButtonColor: Sets the color of the radio button which has been selected (Default: #000)
  • optionTextStyling: Sets custom styling for the option Text next to the Radio Button

Examples

1. Using without Optional Props

Import

import RadioButtons from "react-native-custom-radio-buttons"

Usage

function Example(){
    const [option, setOption] = useState("");
    const options = ["Option 1", "Option 2", "Option 3"];

    return (
        <View style={styles.container}>
            <View style={{ width: "80%" }}>
            {options.map((obj) => (
                <RadioButtons
                    text={obj}
                    setOption={(val) => setOption(val)}
                    selected={option}
                    key={obj}
                />
                ))}
            </View>
            <View style={{ marginTop: 20 }}>
                <Text>Selected Option is: {option}</Text>
            </View>
        </View>
}

Example Screenshot

2. Using with Optional Props

Import

import RadioButtons from "react-native-custom-radio-buttons"

Usage

function Example(){
    const [option, setOption] = useState("");
    const options = ["Option 1", "Option 2", "Option 3"];

    return (
        <View style={styles.container}>
            <View style={{ width: "80%" }}>
            {options.map((obj) => (
                <RadioButtons
                    text={obj}
                    setOption={(val) => setOption(val)}
                    selected={option}
                    radioButtonBorderColor="#2ecc71"
                    radioButtonSize={24}
                    selectedRadioButtonColor="#2ecc71"
                    optionTextStyling={{fontSize: 24, color: "#2ecc71"}}
                    key={obj}
                />
                ))}
            </View>
            <View style={{ marginTop: 20 }}>
                <Text>Selected Option is: {option}</Text>
            </View>
        </View>
}

Example Screenshot

Issues and Contribution

Feel free to add any new feature, open issues or fork and create your own version of it with proper crediting.

You might also like...

TryShape is an open-source platform to create shapes of your choice using a simple, easy-to-use interface. You can create banners, circles, polygonal shapes, export them as SVG, PNG, and even as CSS.

TryShape is an open-source platform to create shapes of your choice using a simple, easy-to-use interface. You can create banners, circles, polygonal shapes, export them as SVG, PNG, and even as CSS.

Create, Export, Share, and Use any Shapes of your choice. View Demo · Report Bug · Request Feature 👋 Introducing TryShape TryShape is an opensource p

Dec 26, 2022

Simple React Native marquee component,fully implemented using reanimated v2,support to iOS/Android/Web.

@react-native-reanimated-community/react-native-reanimated-marquee Simple React Native marquee component,fully implemented using reanimated v2,support

Sep 25, 2022

An easy-to-use super customisable form validation library for React.

An easy-to-use  super customisable form validation library for React.

An easy-to-use super customisable form validation library for React. This library handles all of your form states using built in useReducer hook of react.

Jun 30, 2022

A collection of sample apps built using GetStream and React Native

React Native samples [ Built with ♥ at Stream ] This repo contains projects and samples developed by the team and Stream community, using React Native

Jan 8, 2023

Boilerplate to build Cross-Platform Apps with Expo and React Native

Expo and React Native Boilerplate Boilerplate to build Cross-Platform Apps with Expo and React Native What are you going to find in this boilerplate E

Apr 29, 2022

Fully typed hooks and utility functions for the React Native StyleSheet API

react-native-style-utilities Fully typed hooks and utility functions for the React Native StyleSheet API npm i react-native-style-utilities ESLint Set

Dec 17, 2022

Further split the React Native code based on Metro build to improve performance, providing `Dll` and `Dynamic Imports` features

Further split the React Native code based on Metro build to improve performance, providing `Dll` and `Dynamic Imports` features

React-Native Code Splitting Further split the React Native code based on Metro build to improve performance, providing Dll and Dynamic Imports feature

Dec 29, 2022

React Native's Global Alert Component that can be fully customized and without the need of a state.

React Native's Global Alert Component that can be fully customized and without the need of a state.

🚩 React Native Easy Alert React Native Easy Alert Component. Watch on youtube Easy Alert example app. React Native's Global Alert Component that can

Feb 21, 2022

Free React Native library to display local notifications.

Free React Native library to display local notifications.

React-Native NotiFREE ⚛ React Native library to display local notifications. A FREE alternative to React Native NotiFEE. Why? Nobody can remove the gr

Nov 10, 2022
Owner
Neelesh Ranjan Jha
Neelesh Ranjan Jha
null 136 Dec 30, 2022
Bursting particle effect buttons for React 🎉

react-particle-effect-button (demo) Bursting particle effect buttons for React. This library is a React port of an awesome Codrops Article by Luis Man

Travis Fischer 1.5k Dec 23, 2022
Plock is a responsive masonry layout implementation for React. Very simple to use and easy to understand.

About Plock ?? Plock is a responsive masonry layout implementation for React. Very simple to use and easy to understand. Can I see a demo? ?? The demo

Renato Pozzi 130 Dec 9, 2022
An easy to use and simple masonry layout for React Js based on flexbox column.

React Masonry An easy to use and simple masonry layout for React Js based on flexbox column. Live Preview / Demo In Here Basic Usage Masonry Layout <M

null 16 Dec 23, 2022
React Native & Expo music player application UI

Would you like to support me? Musicont React Native & Expo music player application UI Demo: https://expo.io/@jsxclan/musicont APK: Download on Google

JSX Clan 82 Dec 14, 2022
This project is a Vegan recipe application. I created with React Native. Check out VeganRecipe now for recipe app

VeganRecipe ?? ?? ?? ?? Hello! This project is a Vegan recipe application. I created with React Native. Check out VeganRecipe now for recipe app. ?? ?

Murat 4 Mar 27, 2022
A personal project, made with React, React Native, Typescript and some of the most used front-end libraries.

A personal project, made with React, React Native, Typescript and some of the most used front-end libraries.

Alvaro Junior 1 Jul 23, 2022
📋 React Hooks for forms validation (Web + React Native)

English | 繁中 | 简中 | 日本語 | 한국어 | Français | Italiano | Português | Español | Русский | Deutsch | Türkçe Features Built with performance and DX in mind

React Hook Form 32.4k Dec 29, 2022
A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router.

A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router. It also includes a theme switcher from light to dark mode.

Franklin Okolie 4 Jun 5, 2022
Buttons For The Web

cssbuttons.app Button collection with a focus on simplicity and ease of use. Tech Stack: Next.js, Tailwind CSS, CSS Report Bug Found a bug? Report it

Guilherme Rizzo 180 Dec 11, 2022