1. Components
  2. File

Components

File

Example
const fields: IField[] = [
	{
		type: 'file', // required
		name: 'name-file', // require
		attributes: {
			id: 'id-field', // optional
			classes: ['form-control'], // optional
			label: 'Image' // optional
		},
		extra: {
			multiple: true, // optional
			showPreview: true // optional
		},
		rules: ['file'], // optional
		file: {
			// optional
			// need to add this attribute object if you need a file rule
			extensions: ['jpg', 'gif', 'png'],
			maxSize: 5
		}
	}
];
Result
  • extensions: jpg,gif,png
  • maxSize: 5