{ "component": "input", "fixtures": [ { "name": "default", "options": { "label": { "text": "National Insurance number" }, "id": "input-example", "name": "test-name" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with hint text", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-with-hint-text", "name": "test-name-2" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with error message", "options": { "label": { "text": "National Insurance number" }, "id": "input-with-error-message", "name": "test-name-3", "errorMessage": { "text": "Enter a National Insurance number in the correct format" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n

\n Error: Enter a National Insurance number in the correct format\n

\n \n
" }, { "name": "with error and hint", "options": { "id": "with-error-hint", "name": "with-error-hint", "label": { "text": "National insurance number" }, "errorMessage": { "text": "Enter a National Insurance number in the correct format" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n

\n Error: Enter a National Insurance number in the correct format\n

\n \n
" }, { "name": "with width-2 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-2", "name": "test-width-2", "classes": "govuk-input--width-2" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with width-3 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-3", "name": "test-width-3", "classes": "govuk-input--width-3" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with width-4 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-4", "name": "test-width-4", "classes": "govuk-input--width-4" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with width-5 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-5", "name": "test-width-5", "classes": "govuk-input--width-5" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with width-10 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-10", "name": "test-width-10", "classes": "govuk-input--width-10" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with width-20 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-20", "name": "test-width-20", "classes": "govuk-input--width-20" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with width-30 class", "options": { "label": { "text": "National insurance number" }, "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." }, "id": "input-width-30", "name": "test-width-30", "classes": "govuk-input--width-30" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "with label as page heading", "options": { "label": { "text": "National Insurance number", "classes": "govuk-label--l", "isPageHeading": true }, "id": "input-with-page-heading", "name": "test-name" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n

\n \n

\n \n
" }, { "name": "with optional form-group classes", "options": { "label": { "text": "National Insurance number" }, "id": "input-example", "name": "test-name", "formGroup": { "classes": "extra-class" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with autocomplete attribute", "options": { "label": { "text": "Postcode" }, "id": "input-with-autocomplete-attribute", "name": "postcode", "autocomplete": "postal-code" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with pattern attribute", "options": { "label": { "text": "Numbers only" }, "id": "input-with-pattern-attribute", "name": "numbers-only", "type": "number", "pattern": "[0-9]*" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with spellcheck enabled", "options": { "label": { "text": "Spellcheck is enabled" }, "id": "input-with-spellcheck-enabled", "name": "spellcheck", "type": "text", "spellcheck": true }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with spellcheck disabled", "options": { "label": { "text": "Spellcheck is disabled" }, "id": "input-with-spellcheck-disabled", "name": "spellcheck", "type": "text", "spellcheck": false }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with autocapitalize turned off", "options": { "label": { "text": "Autocapitalize is turned off" }, "id": "input-with-autocapitalize-off", "name": "autocapitalize", "type": "text", "autocapitalize": "none" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "disabled", "options": { "label": { "text": "Disabled input" }, "id": "disabled-input", "disabled": true }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with prefix", "options": { "label": { "text": "Amount, in pounds" }, "id": "input-with-prefix", "name": "amount", "prefix": { "text": "£" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
\n
" }, { "name": "with suffix", "options": { "label": { "text": "Weight, in kilograms" }, "id": "input-with-suffix", "name": "weight", "suffix": { "text": "kg" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n \n
kg
\n
\n
" }, { "name": "with prefix and suffix", "options": { "label": { "text": "Cost per item, in pounds" }, "id": "input-with-prefix-suffix", "name": "cost", "prefix": { "text": "£" }, "suffix": { "text": "per item" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
per item
\n
\n
" }, { "name": "with prefix and long suffix", "options": { "label": { "text": "Cost per item, in pounds, per household member" }, "id": "input-with-prefix-suffix", "name": "cost", "prefix": { "text": "£" }, "suffix": { "text": "per household member" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
per household member
\n
\n
" }, { "name": "with prefix and suffix and error", "options": { "label": { "text": "Cost per item, in pounds" }, "id": "input-with-prefix-suffix", "name": "cost", "prefix": { "text": "£" }, "suffix": { "text": "per item" }, "errorMessage": { "text": "Error message goes here" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n

\n Error: Error message goes here\n

\n
\n
£
\n \n
per item
\n
\n
" }, { "name": "with prefix and suffix and width modifier", "options": { "label": { "text": "Cost per item, in pounds" }, "id": "input-with-prefix-suffix", "name": "cost", "classes": "govuk-input--width-5", "prefix": { "text": "£" }, "suffix": { "text": "per item" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
per item
\n
\n
" }, { "name": "with extra letter spacing", "options": { "id": "input-with-extra-letter-spacing", "label": { "text": "National insurance number" }, "classes": "govuk-input--width-30 govuk-input--extra-letter-spacing", "value": "QQ 12 34 56 C" }, "hidden": false, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "classes", "options": { "id": "with-classes", "name": "with-classes", "label": { "text": "With classes" }, "classes": "app-input--custom-modifier" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "custom type", "options": { "id": "with-custom-type", "name": "with-custom-type", "label": { "text": "With custom type" }, "type": "number" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "value", "options": { "id": "with-value", "name": "with-value", "label": { "text": "With value" }, "value": "QQ 12 34 56 C" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "zero value", "options": { "id": "with-zero-value", "name": "with-zero-value", "label": { "text": "With zero value" }, "value": 0 }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with describedBy", "options": { "id": "with-describedby", "name": "with-describedby", "label": { "text": "With describedBy" }, "describedBy": "test-target-element" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "attributes", "options": { "id": "with-attributes", "name": "with-attributes", "label": { "text": "With attributes" }, "attributes": { "data-attribute": "my data value" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "hint with describedBy", "options": { "id": "with-hint-describedby", "name": "with-hint-describedby", "label": { "text": "With hint describedBy" }, "describedBy": "test-target-element", "hint": { "text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’." } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n
\n \n
" }, { "name": "error with describedBy", "options": { "id": "with-error-describedby", "name": "with-error-describedby", "label": { "text": "With error describedBy" }, "describedBy": "test-target-element", "errorMessage": { "text": "Error message" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n

\n Error: Error message\n

\n \n
" }, { "name": "with error, hint and describedBy", "options": { "id": "with-error-hint-describedby", "name": "with-error-hint-describedby", "label": { "text": "With error, hint and describedBy" }, "errorMessage": { "text": "Error message" }, "hint": { "text": "Hint" }, "describedBy": "test-target-element" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n Hint\n
\n

\n Error: Error message\n

\n \n
" }, { "name": "inputmode", "options": { "id": "with-inputmode", "name": "with-inputmode", "label": { "text": "With inputmode" }, "inputmode": "decimal" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n \n
" }, { "name": "with prefix with html as text", "options": { "label": { "text": "Amount, in pounds" }, "id": "input-with-prefix", "name": "amount", "prefix": { "text": "£" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
<span>£</span>
\n \n
\n
" }, { "name": "with prefix with html", "options": { "label": { "html": "Amount, in pounds" }, "id": "input-with-prefix", "name": "amount", "prefix": { "html": "£" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
\n
" }, { "name": "with prefix with classes", "options": { "label": { "text": "Amount, in pounds" }, "id": "input-with-prefix-element", "name": "amount", "prefix": { "text": "£", "classes": "app-input__prefix--custom-modifier" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
\n
" }, { "name": "with prefix with attributes", "options": { "label": { "text": "Amount, in pounds" }, "id": "input-with-prefix-element", "name": "amount", "prefix": { "text": "£", "attributes": { "data-attribute": "value" } } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
\n
" }, { "name": "with suffix with html as text", "options": { "label": { "text": "Weight, in kilograms" }, "id": "input-with-suffix", "name": "weight", "suffix": { "text": "kg" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n \n
<span>kg</span>
\n
\n
" }, { "name": "with suffix with html", "options": { "label": { "text": "Weight, in kilograms" }, "id": "input-with-suffix", "name": "weight", "suffix": { "html": "kg" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n \n
kg
\n
\n
" }, { "name": "with suffix with classes", "options": { "label": { "text": "Weight, in kilograms" }, "id": "input-with-suffix", "name": "weight", "suffix": { "html": "kg", "classes": "app-input__suffix--custom-modifier" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n \n
kg
\n
\n
" }, { "name": "with suffix with attributes", "options": { "label": { "text": "Weight, in kilograms" }, "id": "input-with-suffix", "name": "weight", "suffix": { "html": "kg", "attributes": { "data-attribute": "value" } } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n \n
kg
\n
\n
" }, { "name": "with customised input wrapper", "options": { "label": { "text": "Cost per item, in pounds" }, "id": "input-with-customised-input-wrapper", "name": "cost", "inputWrapper": { "classes": "app-input-wrapper--custom-modifier", "attributes": { "data-attribute": "value" } }, "prefix": { "text": "£" }, "suffix": { "text": "per item" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "screenshot": false, "html": "
\n \n
\n
£
\n \n
per item
\n
\n
" } ] }