File Uploader

Компонент загрузки для файлов.

Установка

import {FileUploader} from '@xsolla/uikit';

Использование

<FileUploader
  input={{
    name: 'file',
    value: '',
    onChange: () => void
  }}
  meta={{
    touched: false,
    error: null
  }}
  content={{}}
  onUpload={(currentEvent) => Promise<any>} 
/>

Примеры

Default content
Title
Custom content
My custom title
My custom description
Uploading error
Title
Redux Form error
Title
Disabled
Title

API

PropertyDescriptionTypeDefault
inputconfig for redux-form or basic inputObject{}
metameta for redux-form or basic inputObject{touched: false, error: null}
contentinner contentObject{...defaultContent}
onUploadprocess of uploading fileCallbackundefined
dataIdattribute for data identifierstring

CONTENT API

PropertyDescriptionTypeDefault
titleoptional: title of componentString'Title'
descriptionoptional: description of componentString''
extraoptional: uploading button configsObject{children: 'Add', icon: 'plus', renderIcon: null}
renderExtraoptional: custom render for extraCallbacknull