{ "component": "date-input", "fixtures": [ { "name": "default", "options": { "id": "dob" }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": false }, { "name": "complete question", "options": { "id": "dob", "namePrefix": "dob", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "items": [ { "name": "day", "classes": "govuk-input--width-2" }, { "name": "month", "classes": "govuk-input--width-2" }, { "name": "year", "classes": "govuk-input--width-4" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with errors only", "options": { "id": "dob-errors", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "errorMessage": { "text": "Error message goes here" }, "items": [ { "name": "day", "classes": "govuk-input--width-2 govuk-input--error" }, { "name": "month", "classes": "govuk-input--width-2 govuk-input--error" }, { "name": "year", "classes": "govuk-input--width-4 govuk-input--error" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n

\n Error: Error message goes here\n

\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with errors and hint", "options": { "id": "dob-errors", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "errorMessage": { "text": "Error message goes here" }, "items": [ { "name": "day", "classes": "govuk-input--width-2 govuk-input--error" }, { "name": "month", "classes": "govuk-input--width-2 govuk-input--error" }, { "name": "year", "classes": "govuk-input--width-4 govuk-input--error" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n \n \n

\n Error: Error message goes here\n

\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with error on day input", "options": { "id": "dob-day-error", "namePrefix": "dob-day-error", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "errorMessage": { "text": "Error message goes here" }, "items": [ { "name": "day", "classes": "govuk-input--width-2 govuk-input--error" }, { "name": "month", "classes": "govuk-input--width-2" }, { "name": "year", "classes": "govuk-input--width-4" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n \n \n

\n Error: Error message goes here\n

\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with error on month input", "options": { "id": "dob-month-error", "namePrefix": "dob-month-error", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "errorMessage": { "text": "Error message goes here" }, "items": [ { "name": "day", "classes": "govuk-input--width-2" }, { "name": "month", "classes": "govuk-input--width-2 govuk-input--error" }, { "name": "year", "classes": "govuk-input--width-4" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n \n \n

\n Error: Error message goes here\n

\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with error on year input", "options": { "id": "dob-year-error", "namePrefix": "dob-year-error", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "errorMessage": { "text": "Error message goes here" }, "items": [ { "name": "day", "classes": "govuk-input--width-2" }, { "name": "month", "classes": "govuk-input--width-2" }, { "name": "year", "classes": "govuk-input--width-4 govuk-input--error" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n \n \n

\n Error: Error message goes here\n

\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with default items", "options": { "id": "dob", "namePrefix": "dob", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" } }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with optional form-group classes", "options": { "id": "dob", "namePrefix": "dob", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "formGroup": { "classes": "extra-class" } }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with autocomplete values", "options": { "id": "dob-with-autocomplete-attribute", "namePrefix": "dob-with-autocomplete", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "items": [ { "name": "day", "classes": "govuk-input--width-2", "autocomplete": "bday-day" }, { "name": "month", "classes": "govuk-input--width-2", "autocomplete": "bday-month" }, { "name": "year", "classes": "govuk-input--width-4", "autocomplete": "bday-year" } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with input attributes", "options": { "id": "dob-with-input-attributes", "namePrefix": "dob-with-input-attributes", "fieldset": { "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" }, "items": [ { "name": "day", "classes": "govuk-input--width-2", "attributes": { "data-example-day": "day" } }, { "name": "month", "classes": "govuk-input--width-2", "attributes": { "data-example-month": "month" } }, { "name": "year", "classes": "govuk-input--width-4", "attributes": { "data-example-year": "year" } } ] }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "classes", "options": { "id": "with-classes", "classes": "app-date-input--custom-modifier" }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "attributes", "options": { "id": "with-attributes", "attributes": { "data-attribute": "my data value" } }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "with empty items", "options": { "id": "with-empty-items", "items": [] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "custom pattern", "options": { "id": "with-custom-pattern", "items": [ { "name": "day", "pattern": "[0-8]*" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "custom inputmode", "options": { "id": "with-custom-inputmode", "items": [ { "name": "day", "pattern": "[0-9X]*", "inputmode": "text" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "with nested name", "options": { "id": "with-nested-name", "items": [ { "name": "day[dd]" }, { "name": "month[mm]" }, { "name": "year[yyyy]" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "with id on items", "options": { "id": "with-item-id", "items": [ { "id": "day", "name": "day" }, { "id": "month", "name": "month" }, { "id": "year", "name": "year" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "suffixed id", "options": { "id": "my-date-input", "items": [ { "name": "day" }, { "name": "month" }, { "name": "year" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "with values", "options": { "id": "with-values", "items": [ { "id": "day", "name": "day" }, { "id": "month", "name": "month" }, { "id": "year", "name": "year", "value": 2018 } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "with hint and describedBy", "options": { "id": "dob-errors", "fieldset": { "describedBy": "some-id", "legend": { "text": "What is your date of birth?" } }, "hint": { "text": "For example, 31 3 1980" } }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n For example, 31 3 1980\n
\n\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "with error and describedBy", "options": { "id": "dob-errors", "fieldset": { "describedBy": "some-id", "legend": { "text": "What is your date of birth?" } }, "errorMessage": { "text": "Error message goes here" } }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n

\n Error: Error message goes here\n

\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "fieldset html", "options": { "id": "with-fieldset-html", "fieldset": { "legend": { "html": "What is your date of birth?" } } }, "html": "
\n
\n \n \n \n What is your date of birth?\n \n \n \n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "items with classes", "options": { "id": "with-item-classes", "items": [ { "name": "day", "classes": "app-date-input__day" }, { "name": "month", "classes": "app-date-input__month" }, { "name": "year", "classes": "app-date-input__year" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true }, { "name": "items without classes", "options": { "id": "without-item-classes", "items": [ { "name": "day" }, { "name": "month" }, { "name": "year" } ] }, "html": "
\n\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n
\n\n
", "hidden": true } ] }