npm.io
0.2.12 • Published 8 years ago

@govuk-react/date-input

Licence
MIT
Version
0.2.12
Deps
7
Size
69 kB
Vulns
0
Weekly
0

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