# File Upload File upload allows users to upload and attach one or more files. It shows the upload progress and status of each file. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-file-upload--introduction ## Variants documented in Storybook - EntryStates: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-file-upload--entrystates - UploadedAndErrorStates: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-file-upload--uploadedanderrorstates ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for File Upload. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Entry States — Entry States HTML: ```html
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Scanning
Drop file here
File type: PDF JPG PNG Max size: 5 MB
error_outline
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
error_outline
Drop file here
File type: PDF JPG PNG Max size: 5 MB
error_outline
Scanning
error_outline
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Scanning
File upload allows users to upload and attach one or more files. It shows the upload progress and status of each file.
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
File upload allows users to upload and attach one or more files. It shows the upload progress and status of each file.
Drop file here
File type: PDF JPG PNG Max size: 5 MB
error_outline
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
error_outline
File upload allows users to upload and attach one or more files. It shows the upload progress and status of each file.
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
Could not scan
[File Name] exceeds the 5MB upload limit. Please compress it or select a smaller file.
Drop file here
File type: PDF JPG PNG Max size: 5 MB
error_outline
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
error_outline
Could not scan
[File Name] exceeds the 5MB upload limit. Please compress it or select a smaller file.
Drop file here
File type: PDF JPG PNG Max size: 5 MB
Upload or scan document
File type: PDF JPG PNG Max size: 5 MB
Could not scan
[File Name] exceeds the 5MB upload limit. Please compress it or select a smaller file.