@govuk-react/file-upload

    0.9.0 • Public • Published

    FileUpload

    Import

      import FileUpload from '@govuk-react/file-upload';

    Usage

    Simple

    import { FileUpload } from 'govuk-react'
    
    <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

    Keywords

    none

    Install

    npm i @govuk-react/file-upload

    DownloadsWeekly Downloads

    3,201

    Version

    0.9.0

    License

    MIT

    Unpacked Size

    42.1 kB

    Total Files

    19

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar