FileUpload
Basic usage
Section titled “Basic usage”import { FileUploadField } from '@eekodigital/raster';
<FileUploadField label="Upload supporting document" name="document" /> With hint text
Section titled “With hint text”PDF, DOCX or XLSX. Max 10 MB.
<FileUploadField
label="Upload supporting document"
name="document"
hint="PDF, DOCX or XLSX. Max 10 MB."
/> With error
Section titled “With error”Error: Select a file to upload
<FileUploadField
label="Upload supporting document"
name="document"
error="Select a file to upload"
/> Restricting file types and multiple selection
Section titled “Restricting file types and multiple selection”Use the native accept attribute to restrict file types, and multiple
to allow more than one file at once.
JPG or PNG only.
<FileUploadField
label="Upload images"
name="images"
hint="JPG or PNG only."
accept="image/jpeg,image/png"
multiple
/> | Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Visible label for the file input. |
hint | string | — | Optional hint text below the label. |
error | string | — | Validation error message. |
…props | InputHTMLAttributes | — | All native |