Socket
Socket
Sign inDemoInstall

react-radio-buttons-group

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-radio-buttons-group

React component for a group of radio buttons


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

npm npm

React Radio Buttons Group

React component for a group of radio buttons built with and for React.

demo

stacklevel

Installation

npm install react-radio-buttons-group --save

Usage

<ReactRadioButtonsGroup/> with a list of <ReactRadioButton/> components generate a hidden radio inputs that contain checked value, so you can submit it as part of a standard form.

When the value is changed, onChange(inputRadioValue) will fire.

import { ReactRadioButtonsGroup, ReactRadioButton } from 'react-radio-buttons-group';

const RadioButtons = () => (
    <ReactRadioButtonsGroup group='sex' onChange={(value) => console.log(value)}>
        <ReactRadioButton value='male'>Male 👨</ReactRadioButton>
        <ReactRadioButton value='female'>Female 👩</ReactRadioButton>
    </ReactRadioButtonsGroup>
);

Demo & Examples

Coming soon...

demo

Components API

<ReactRadioButtonsGroup/>
PropertyTypeDescription
childrenfunctionChild function responsible for rendering the <ReactRadioButton/> components.
groupstringField name, for hidden <input /> tags
onChangefunctionFunction responsible for handling radio group changes. (inputRadioValue) => { }
<ReactRadioButton/>
PropertyTypeDescription
childrenfunctionChild function responsible for rendering the content into the <label>.
valuestringAttribute value for hidden <input type='radio' /> tag. Also uses as id attribute for <input type='radio' /> and for attribute for <label>.

Keywords

FAQs

Last updated on 29 Mar 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc