@mik-a/tiny-uploader

1.2.3 • Public • Published

tiny-uploader

Customizable React component/button for uploading text files.

Works with most common text documents such as .txt and .md

Installation

npm i @mik-a/tiny-uploader --save

Usage

import UploadeTextFile from '@mik-a/tiny-uploader'

<UploadTextFile fileContentHandler={fileContentHandler} fileInfo={fileInfoHandler} label='Upload' className='my-custom-class' />

// Example of functions

  const fileContentHandler = e => {
    console.log('text content: ', e)
  }

  const fileInfoHandler = e => {
    console.log('file info', e)
    // name, lastModified, webkitRelativePath , size , type 
  }

Props

fileContentHandler // function()

FileInfo // function()

Optional props

label // 'string' - default 'Upload text'

className // 'string' - your custom CSS class

Default CSS

.tiny-uploader {
	border: 1px solid;
	padding: 0.8rem 1.8rem;
	border-radius: 1.8rem;
}

Author

Readme

Keywords

none

Package Sidebar

Install

npm i @mik-a/tiny-uploader

Weekly Downloads

8

Version

1.2.3

License

ISC

Unpacked Size

10.6 kB

Total Files

7

Last publish

Collaborators

  • mik-a