0.7.2 • Published 3 years ago
@slice-and-dice/govuk-react-file-upload v0.7.2
FileUpload
Import
import FileUpload from '@govuk-react/file-upload';
Usage
Simple
<FileUpload name="group0">Upload a document</FileUpload>
Input with hint text
<FileUpload
name="group1"
acceptedFormats=".jpg, .png"
hint={['This can be in either JPG or PNG format']}
>
Upload a photo
</FileUpload>
Input with hint text & error
const meta = {
touched: true,
error: 'Example',
};
<FileUpload
name="group1"
acceptedFormats=".jpg, .png"
hint={['This can be in either JPG or PNG format']}
meta={meta}
>
Upload a photo
</FileUpload>
References:
Properties
Prop | Required | Default | Type | Description |
---|---|---|---|---|
acceptedFormats | undefined | string | ||
children | true | | node | ||
hint | undefined | string | Optional hint text | |
meta | {} | shapeobject Object | Final form meta object, pending adjustment/removal |