Image Upload
premiumImage upload with preview and type/size validation.
Overview
The Image Upload is optimized for image files with a visual preview of the selected image. Validates file type and size like the file upload components.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
name | String | "image" | Field name used in form data. |
label | String | "Upload Image" | Label displayed above the upload area. |
accept | String | "image/*" | Accepted image types. |
maxSize | Number | 5 | Maximum file size in MB. |
required | Boolean | false | Whether an image must be uploaded. |
Features
- Image preview after selection
- Optimized for image file types
- File type and size validation
- Drag-and-drop support
Tips
Defaults to accept="image/*" which allows all image formats (JPEG, PNG, GIF, WebP, etc.).
Use a specific accept value like ".jpg,.png" to restrict to certain formats.
Validation
This component uses file validation. See the Validation Guide for details on configuring rules and error messages.