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

3.0.2 • Public • Published

@axa-fr/react-toolkit-form-core

Installation

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

FieldForm

Import

import { Field, HelpMessage } from '@axa-fr/react-toolkit-form-core';
import '@axa-fr/react-toolkit-form-core/dist/af-form.css';

Use

const FieldForm = () => (
  <Field id="uniqueId" label="Your Label">
    <textarea name="placeName" placeholder="Paris"></textarea>
    <HelpMessage message="Enter the place name, ex : Webcenter" />
  </Field>
);
export default FieldForm;

forceDisplayMessage

The default behavior prevents HelpMessage from displaying until the user interacts (change or focus event) with Field

You can bypass this behavior to display message anyway by setting the property forceDisplayMessage to true (false by default)

<Field id="uniqueId" label="Your Label" forceDisplayMessage />

Or

<Field id="uniqueId" label="Your Label" forceDisplayMessage={true} />

You can add this parameter to any input from the toolkit since inputs pass their props to Field

Readme

Keywords

none

Package Sidebar

Install

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

Weekly Downloads

90

Version

3.0.2

License

MIT

Unpacked Size

139 kB

Total Files

120

Last publish

Collaborators

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