This package has been deprecated

Author message:

This package is no longer used by RAFB and is not maintained so may be insecure

@slice-and-dice/govuk-react-date-field

0.7.3 • Public • Published

DateField

Import

  import DateField from '@govuk-react/date-field';

Usage

Simple

<DateField>What is your date of birth?</DateField>

Date with hint text

<DateField hintText="For example, 31 03 1980">
  What is your date of birth?
</DateField>

Date with hint text & error

<DateField
  hintText="For example, 31 03 1980"
  errorText="Error message goes here"
>
  What is your date of birth?
</DateField>

With custom input name props

<DateField hintText="For example, 31 03 1980"
  inputNames={{
    day: 'dayInputName',
    month: 'monthInputName',
    year: 'yearInputName',
  }}
 >
  What is your date of birth?
</DateField>

References:

Properties

Prop Required Default Type Description
children true `````` node
defaultValues { day: undefined, month: undefined, year: undefined, } custom
errorText undefined string Error text
hintText undefined string Optional hint text
input undefined shape[object Object] Properties that are sent to the input, matching final form and redux form input type
inputNames { day: undefined, month: undefined, year: undefined, } shape[object Object] Input name attributes

Readme

Keywords

none

Package Sidebar

Install

npm i @slice-and-dice/govuk-react-date-field

Weekly Downloads

1

Version

0.7.3

License

MIT

Unpacked Size

215 kB

Total Files

23

Last publish

Collaborators

  • matthew-moles-civica
  • simon.thomas
  • davidbrown123
  • pktw2827
  • paul.burnett
  • jcunninghamciv
  • kieran-clifton-civica
  • ernestas.leliuga
  • leah.pitter