New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@invisionag/iris-react-radio

Package Overview
Dependencies
Maintainers
22
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@invisionag/iris-react-radio

```js import Radio, { RadioGroup } from '@invisionag/iris-react-radio'; ```

latest
Source
npmnpm
Version
4.5.2
Version published
Weekly downloads
78
387.5%
Maintainers
22
Weekly downloads
 
Created
Source
import Radio, { RadioGroup } from '@invisionag/iris-react-radio';

react-radio is a component that enables a user to chose between multiple choices. the layouting of these choices depends on what component gets put into the radio group.

Usage

Basic

<RadioGroup name="basic-group">
  <Radio value="1">First Option</Radio>
  <Radio value="2">Second Option</Radio>
</RadioGroup>

Preselected value

<RadioGroup name="basic-group" selectedValue="1">
  <Radio value="1">First Option</Radio>
  <Radio value="2">Second Option</Radio>
</RadioGroup>

Card layout

Instead of the default radio button layout, you can use clickable cards to render your options. Cards children will be displayed in the body, while the optional header prop expects valid jsx that will be rendered as a heading. Cards behave just like the Radio elements and can be mixed with them.

import RadioCard from '@invisionag/iris-react-radio/Card';
<RadioGroup name="basic-group" selectedValue="1">
  <RadioCard value="1">First Option</RadioCard>
  <RadioCard value="2" header={<h1>Second</h1>}>Second Option</RadioCard>
  <RadioCard value="3">Third Option</RadioCard>
</RadioGroup>

OnChange handler

Radios can receive an onChange handler, which will get executed before the builtin handler.

<RadioGroup name="basic-group" selectedValue="1">
  <Radio value="1" onChange={() => console.log('radio button changes')}>First Option</Radio>
  <Radio value="2">Second Option</Radio>
</RadioGroup>

Note that input elements only fire their onChange event when a radio gets selected. If, because of that, another radio gets deselected, this one won't fire.

FAQs

Package last updated on 28 Jun 2021

Did you know?

Socket

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