File Upload
The File Upload component allows users to select and upload one or multiple files. It supports file type restrictions, size limits, preview functionality, and comprehensive validation.
Examples
Upload multiple files with validation
Form Data:
{}
Field Properties
Name | Description | Type |
---|---|---|
multiple | Enable selection of multiple files | boolean |
accept | Comma-separated list of accepted file types (MIME types or extensions) | string |
maxSize | Maximum file size in bytes (e.g., 5242880 for 5MB) | number |
maxFiles | Maximum number of files that can be selected | number |
preview | Show preview thumbnails for selected files | boolean |
displayType | Component display type identifier | string |
displayName | Label displayed above the file input | string |
placeholder | Placeholder text shown in the file input area | string |
readOnly | Make the field read-only (users cannot modify selection) | boolean |
required | Make file selection mandatory | boolean |
Validation Properties
The validation settings within the Text area component are crucial for ensuring that user input meets specific requirements. Here’s a breakdown of the available validation properties:
Property | Description |
---|---|
required | Whether file selection is mandatory |
minLength | Specifies the minimum number of characters allowed in the input. |
maxLength | Specifies the maximum number of characters allowed in the input. |
max | Specifies the maximum value allowed for number inputs, also supporting dynamic conditions. |
min | Specifies the minimum value allowed for number inputs, with support for dynamic values. |
pattern | A regex pattern that the input must match to be considered valid. |
validate | A function for custom validation logic, which can return a boolean or an error message. |
requiredDetail | Contains info msgs about the required validation property |