# @govuk-react/date-input

> Date input component displaying day, month and year and featuring several configurable options.

Latest version **0.2.12** (published 2018-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @govuk-react/date-input
pnpm add @govuk-react/date-input
yarn add @govuk-react/date-input
bun add @govuk-react/date-input
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.12 |
| Published | 2018-09-26 |
| First published | 2018-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 68.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alasdair McLeay |
| Maintainers | loque-, marksy, penx, petelockey, steve_sims |

## Links

- npm: https://www.npmjs.com/package/@govuk-react/date-input
- Homepage: https://github.com/UKHomeOffice/govuk-react/tree/master/components/date-input
- npm.io page: https://npm.io/package/@govuk-react/date-input

## Dependencies (7)

- [govuk-colours](https://npm.io/package/govuk-colours.md) ^1.0.3
- [@govuk-react/hoc](https://npm.io/package/@govuk-react/hoc.md) ^0.2.7
- [@govuk-react/label](https://npm.io/package/@govuk-react/label.md) ^0.2.12
- [@govuk-react/constants](https://npm.io/package/@govuk-react/constants.md) ^0.2.7
- [@govuk-react/hint-text](https://npm.io/package/@govuk-react/hint-text.md) ^0.2.12
- [@govuk-react/error-text](https://npm.io/package/@govuk-react/error-text.md) ^0.2.12
- [@govuk-react/label-text](https://npm.io/package/@govuk-react/label-text.md) ^0.2.12

## Recent versions

- 0.2.12 (latest) — 2018-09-26
- 0.2.9 — 2018-07-17
- 0.2.8 — 2018-07-10
- 0.2.7 — 2018-06-29
- 0.2.6 — 2018-06-29
- 0.2.4 — 2018-06-14
- 0.2.2 — 2018-06-05
- 0.2.1 — 2018-05-18
- 0.2.0 — 2018-05-11
- 0.1.28 — 2018-04-19
- 0.1.27 — 2018-04-06
- 0.1.26 — 2018-04-06
- 0.1.25 — 2018-04-03
- 0.1.24 — 2018-03-26
- 0.1.23 — 2018-03-22
- … 3 more at https://npm.io/package/@govuk-react/date-input/versions

## README

DateInput
=========

### Import
```js
  import DateInput from '@govuk-react/date-input';
```
<!-- STORY -->

### Usage

Simple
```jsx
<DateInput>What is your date of birth?</DateInput>
```

Date with hint text
```jsx
<DateInput hintText="For example, 31 03 1980">
  What is your date of birth?
</DateInput>
```

Date with hint text & error
```jsx
<DateInput
  hintText="For example, 31 03 1980"
  errorText="Error message goes here"
>
  What is your date of birth?
</DateInput>
```

With custom input name props
```jsx
<DateInput inputNames={{ day: 'dayInputName' }} hintText="For example, 31 03 1980">
  What is your date of birth?
</DateInput>
```

### References:
- https://github.com/alphagov/govuk-frontend/tree/master/src/components/date-input

### 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

---
_Source: https://npm.io/package/@govuk-react/date-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
