{ "component": "file-upload", "fixtures": [ { "name": "default", "options": { "id": "file-upload-1", "name": "file-upload-1", "label": { "text": "Upload a file" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "
\n \n \n
" }, { "name": "with hint text", "options": { "id": "file-upload-2", "name": "file-upload-2", "label": { "text": "Upload your photo" }, "hint": { "text": "Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto." } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "
\n \n
\n Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto.\n
\n \n
" }, { "name": "with error message and hint", "options": { "id": "file-upload-3", "name": "file-upload-3", "label": { "text": "Upload a file" }, "hint": { "text": "Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto." }, "errorMessage": { "text": "Error message goes here" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "
\n \n
\n Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto.\n
\n

\n Error: Error message goes here\n

\n \n
" }, { "name": "with value", "options": { "id": "file-upload-4", "name": "file-upload-4", "value": "C:\\fakepath\\myphoto.jpg", "label": { "text": "Upload a photo" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "
\n \n \n
" }, { "name": "with label as page heading", "options": { "id": "file-upload-1", "name": "file-upload-1", "label": { "text": "Upload a file", "classes": "govuk-label--l", "isPageHeading": true } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "
\n

\n \n

\n \n
" }, { "name": "with optional form-group classes", "options": { "id": "file-upload-1", "name": "file-upload-1", "label": { "text": "Upload a file" }, "formGroup": { "classes": "extra-class" } }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "
\n \n \n
" }, { "name": "attributes", "options": { "id": "file-upload-attributes", "name": "file-upload-attributes", "label": { "text": "Upload a file" }, "attributes": { "accept": ".jpg, .jpeg, .png" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "
\n \n \n
" }, { "name": "classes", "options": { "id": "file-upload-classes", "name": "file-upload-classes", "label": { "text": "Upload a file" }, "classes": "app-file-upload--custom-modifier" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "
\n \n \n
" }, { "name": "with describedBy", "options": { "id": "file-upload-describedby", "name": "file-upload-describedby", "label": { "text": "Upload a file" }, "describedBy": "test-target-element" }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "
\n \n \n
" }, { "name": "with hint and describedBy", "options": { "id": "file-upload-hint-describedby", "name": "file-upload-hint-describedby", "label": { "text": "Upload a file" }, "describedBy": "test-target-element", "hint": { "text": "Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto." } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "
\n \n
\n Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto.\n
\n \n
" }, { "name": "error", "options": { "id": "file-upload-with-error", "name": "file-upload-with-error", "label": { "text": "Upload a file" }, "errorMessage": { "text": "Error message" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "
\n \n

\n Error: Error message\n

\n \n
" }, { "name": "with error and describedBy", "options": { "id": "file-upload-error-describedby", "name": "file-upload-error-describedby", "label": { "text": "Upload a file" }, "describedBy": "test-target-element", "errorMessage": { "text": "Error message" } }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "
\n \n

\n Error: Error message\n

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

\n Error: Error message\n

\n \n
" } ] }