@govuk-react/radio

Styled radio button with several configurable props.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@govuk-react/radio
Minified + gzip package size for @govuk-react/radio in KB

Readme

Radio

Import

  import Radio from '@govuk-react/radio';

Usage

Simple

import { Radio } from 'govuk-react'

<Radio name="group1">Radio button text example</Radio>

Radio stacked

 <div>
   <Radio name="group1">Waste from animal carcasses</Radio>
   <Radio name="group1">Waste from mines or quarries</Radio>
   <Radio name="group1">Farm or agricultural waste</Radio>
 </div>

Radio inline

 <div>
   <Radio name="group1" inline>
     Yes
   </Radio>
   <Radio name="group1" inline>
     No
   </Radio>
 </div>

Radio disabled

 <div>
   <Radio name="group1" disabled="disabled">
     Disabled checkbox option
   </Radio>
 </div>

Radio preselected

 <div>
   <Radio name="group1" checked>
     Farm or agricultural waste
   </Radio>
 </div>

Radio preselected & disabled

 <div>
   <Radio name="group1" disabled="disabled" checked>
     Farm or agricultural waste
   </Radio>
 </div>

Radio with hint text

<div>
  <Radio
   name="group1"
   hint="You'll have a user ID if you've registered for Self Assessment or filed a tax return
         online before."
  >
    Sign in with Government Gateway
  </Radio>
</div>

References:

Properties

Prop Required Default Type Description
children true `````` node
className undefined string
hint undefined node
inline false bool

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.