@govuk-react/date-input

0.2.12 • Public • Published

DateInput

Import

  import DateInput from '@govuk-react/date-input';

Usage

Simple

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

Date with hint text

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

Date with hint text & error

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

With custom input name props

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

References:

Properties

Prop Required Default Type Description
children true `````` node
errorText undefined string Error text
hintText undefined string Optional hint text
inputNames { day: 'dateInputDay', month: 'dateInputMonth', year: 'dateInputYear', } shape[object Object] Input name attributes

Readme

Keywords

none

Package Sidebar

Install

npm i @govuk-react/date-input

Weekly Downloads

2

Version

0.2.12

License

MIT

Unpacked Size

70.4 kB

Total Files

19

Last publish

Collaborators

  • loque-
  • marksy
  • penx
  • petelockey
  • steve_sims