0.7.2 • Published 3 years ago

@slice-and-dice/govuk-react-file-upload v0.7.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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

PropRequiredDefaultTypeDescription
acceptedFormatsundefinedstring
childrentrue | node
hintundefinedstringOptional hint text
meta{}shapeobject ObjectFinal form meta object, pending adjustment/removal