@axa-fr/react-toolkit-form-input-choice
TypeScript icon, indicating that this package has built-in type declarations

2.3.1 • Public • Published

@axa-fr/react-toolkit-form-input-choice

  1. ChoiceInput
  2. ChoiceInput Required
  3. Choice

ChoiceInput

Installation

npm i @axa-fr/react-toolkit-form-input-choice
npm i @axa-fr/react-toolkit-form-core

Import

import { ChoiceInput } from '@axa-fr/react-toolkit-form-input-choice';
import '@axa-fr/react-toolkit-form-input-choice/dist/af-radio.css';
import { MessageTypes } from '@axa-fr/react-toolkit-form-core';
import '@axa-fr/react-toolkit-form-core/dist/af-form.css';

Use

const ChoiceInputForm = () => (
  <form className="af-form" name="myform">
    <ChoiceInput
      id="uniqueid"
      name="choiceInputName"
      label="Place type"
      messageType={MessageTypes.error}
      classNameContainerLabel="col-md-2"
      classNameContainerInput="col-md-10"
      onChange={(e) => {
        console.log(e);
      }}
      onClick={(e) => {
        console.log(e);
      }}
    />
  </form>
);
export default ChoiceInputForm;

ChoiceInput Required

To achieve CheckboxInputRequired, you need to add this :

classModifier = 'required';

to the ChoiceInput component

Choice

Installation

npm i @axa-fr/react-toolkit-form-input-choice

Import

import { Choice } from '@axa-fr/react-toolkit-form-input-choice';
import '@axa-fr/react-toolkit-form-input-choice/dist/af-radio.css';

Use

const ChoiceInput = () => (
  <form className="af-form" name="myform">
    <Choice
      name="placeName"
      onChange={(e) => {
        console.log(e);
      }}
    />
  </form>
);
export default ChoiceInput;

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @axa-fr/react-toolkit-form-input-choice

Weekly Downloads

136

Version

2.3.1

License

MIT

Unpacked Size

76.8 kB

Total Files

34

Last publish

Collaborators

  • martinweb
  • fcornaire
  • guillaume.chervet.axa
  • samuel-gomez
  • antoine.blancke
  • arnaudforaison