@tdcerhverv/radio-button
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

RadioButton component

Usage 1

Import like this:

// Default Material UI components
import RadioGroup from '@material-ui/core/RadioGroup';
import FormControl from '@material-ui/core/FormControl';

// Styled Material UI component
import { RadioButton } from '@tdcerhverv/radiobutton';
import { FormHelperText } from '@tdcerhverv/radiobutton';
import { FormControlLabel } from '@tdcerhverv/radiobutton';

Use like this:

const handleChange = () => {};

<FormControl component="fieldset" error={true}>
  <RadioGroup aria-label="quiz" name="quiz1">
    <FormControlLabel
      value="radio1"
      control={<RadioButton onChange={handleChange} />}
      label="Radio label 1"
    />
    <FormControlLabel
      value="radio2"
      control={<RadioButton onChange={handleChange} />}
      label="Radio label 2"
    />
    <FormControlLabel
      value="radio3"
      control={<RadioButton onChange={handleChange} />}
      label="Radio label 3"
    />
  </RadioGroup>
  <FormHelperText>Choose already!</FormHelperText>
</FormControl>;

Usage 2 - Standalone

Import like this:

// Styled Material UI component
import { RadioButton } from '@tdcerhverv/radiobutton';

Use like this:

const handleChange = () => {};

<RadioButton onChange={handleChange} />;

Props

RadioButton

Spreads the default RadioButton props

FormHelperText

Insert error icon before the provided text. Spreads the default FormHelperText props

FormControlLabel

Spreads the default FormControlLabel props

Readme

Keywords

none

Package Sidebar

Install

npm i @tdcerhverv/radio-button

Weekly Downloads

3

Version

4.0.0

License

MIT

Unpacked Size

760 kB

Total Files

28

Last publish

Collaborators

  • antongb
  • dev_jonas
  • jeppebenjaminsen
  • ahhah
  • abdok
  • mikkv
  • clausr1990
  • tdc-sigbe
  • mdige
  • nuudaybot
  • tdc-olila
  • jeroen.dk.nl
  • renand
  • stegr
  • m84100
  • m92212
  • m87979
  • vertic
  • rasladev
  • muddz
  • tajsonik
  • linnt
  • molg