1.2.3 • Published 4 years ago

@mik-a/tiny-uploader v1.2.3

Weekly downloads
7
License
ISC
Repository
github
Last release
4 years ago

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

1.2.3

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago