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

2.3.1 • 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

292

Version

2.3.1

License

MIT

Unpacked Size

152 kB

Total Files

122

Last publish

Collaborators

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