Sha256: 439b5015941aa6f7abf048c8659294abe5c9e8830caf9cd5c29c85f0c38eea44

Contents?: true

Size: 1.85 KB

Versions: 321

Compression:

Stored size: 1.85 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_error_items:
    data:
      legend_text: "What is your date of birth?"
      hint: "For example, 31 3 1980"
      error_items:
        - text: "Error 1"
        - text: "Error 2"
  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

321 entries across 321 versions & 1 rubygems

Version Path
govuk_publishing_components-28.9.2 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.9.1 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.9.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.8.1 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.8.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.7.1 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.6.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.5.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.4.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.3.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.2.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.1.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-28.0.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.20.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.19.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.18.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.17.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.16.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.15.0 app/views/govuk_publishing_components/components/docs/date_input.yml
govuk_publishing_components-27.14.2 app/views/govuk_publishing_components/components/docs/date_input.yml