Sha256: 413c65d4efa5813965aca7609efe761e277e198e84609e436b3f334d26c717c9

Contents?: true

Size: 1.67 KB

Versions: 27

Compression:

Stored size: 1.67 KB

Contents

name: Form date input
description: Use the date input component to help users enter a memorable date or one they can easily look up.
accessibility_criteria: |
  Inputs in the component must:

  * accept focus
  * be focusable with a keyboard
  * be usable with a keyboard
  * be usable with touch
  * indicate when they have focus
  * be recognisable as form input elements
  * have correctly associated labels
  * be of the appropriate type for their use, in this case 'number'

  Labels use the [label component](/component-guide/label).

  Avoid using autofocus and tabindex unless you have user research to support this behaviour.
govuk_frontend_components:
  - date-input
examples:
  default:
    data: {}
  with_name:
    description: |
      Settting a name at the component level helps generating the name for each individual input within the
      component as follows: `custom-name[day]`, `custom-name[month]`, `custom-name[year]`
    data:
      name: "dob"
  with_legend:
    data:
      legend_text: "What is your date of birth?"
  with_hint:
    data:
      legend_text: "What is your date of birth?"
      hint: "For example, 31 3 1980"
  with_error:
    data:
      legend_text: "What is your date of birth?"
      hint: "For example, 31 3 1980"
      error_message: "Error message goes here"
  with_custom_items:
    data:
      legend_text: "Beth yw eich dyddiad geni?"
      hint: "Er enghraifft, 31 3 1980"
      items:
        - label: Dydd
          name: dob-dydd
          width: 2
          value: 31
        - label: Mis
          name: dob-mis
          width: 2
          value: 3
        - label: Blwyddyn
          name: dob-blwyddyn
          width: 4
          value: 1980

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
govuk_publishing_components-16.28.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.27.1 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.27.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.26.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.25.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.24.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.23.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.22.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.21.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.20.1 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.20.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.19.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.18.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.17.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.16.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.15.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.14.1 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.14.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.13.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-16.12.0 app/views/govuk_publishing_components/components/docs/date_input.yml