# Date input ## Introduction A component for entering dates, for example - date of birth. ## Guidance Find out when to use the date input component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/date-input). ## Quick start examples ### Date input [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/preview) #### Markup
Name | Type | Required | Description |
---|---|---|---|
id | string | No | Optional id. This is used for the main component and to compose id attribute for each item. |
namePrefix | string | No | Optional prefix. This is used to prefix each `item.name` using `-`. |
items | array | Yes | An array of input objects with name, value and optional classes |
items.{}.id | string | No | Optional item-specific id. If provided, it will be used instead of the generated id. |
items.{}.name | array | Yes | Item-specific name attribute. |
items.{}.value | string | No | Optional item-specific value attribute. If provided, it will be used as the initial value of the input. |
items.{}.label | string | No | Optional item-specific label text. If provided, this will be used instead of the items.{}.name. |
hint | object | No | Optional hint. See hint component. |
errorMessage | object | No | Optional error message. See errorMessage component. |
fieldset | object | No | Arguments for the fieldset component (e.g. legend). See fieldset component. |
classes | string | No | Optional additional classes to add to the date-input container. |
attributes | object | No | Any extra HTML attributes (for example data attributes) to add to the date-input container. |