npm i @axa-fr/react-toolkit-form-input-choice
npm i @axa-fr/react-toolkit-form-core
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';
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;
To achieve CheckboxInputRequired, you need to add this :
classModifier = 'required';
to the ChoiceInput component
npm i @axa-fr/react-toolkit-form-input-choice
import { Choice } from '@axa-fr/react-toolkit-form-input-choice';
import '@axa-fr/react-toolkit-form-input-choice/dist/af-radio.css';
const ChoiceInput = () => (
<form className="af-form" name="myform">
<Choice
name="placeName"
onChange={(e) => {
console.log(e);
}}
/>
</form>
);
export default ChoiceInput;