This package has been deprecated

Author message:

This package is no longer used by RAFB and is not maintained so may be insecure

@slice-and-dice/govuk-react-file-upload

0.7.2 • Public • Published

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 {} shape[object Object] Final form meta object, pending adjustment/removal

Readme

Keywords

none

Package Sidebar

Install

npm i @slice-and-dice/govuk-react-file-upload

Weekly Downloads

8

Version

0.7.2

License

MIT

Unpacked Size

46.1 kB

Total Files

19

Last publish

Collaborators

  • matthew-moles-civica
  • simon.thomas
  • davidbrown123
  • pktw2827
  • paul.burnett
  • jcunninghamciv
  • kieran-clifton-civica
  • ernestas.leliuga