@hawk-ui/file-upload

4.4.1 • Public • Published

Installation

To install a component run

$ npm install @hawk-ui/file-upload --save

Please import CSS styles via

@import '/path__to__node_modules/@hawk-ui/file-upload/dist/index.min.css

Usage

File Upload With Button:

Demo

import FileUpload from '@hawk-ui/file-upload';
<FileUpload
  btnTitle="Browse"
  accept="images/*"
  isMultiple
  onUpload={(file) => {
    console.log('query file', file);
  }}
/>

File Upload With Icon

Demo

import FileUpload from '@hawk-ui/file-upload';
<FileUpload
  btnIcon="fas fa-upload"
  onUpload={(file) => {
    console.log('query file', file);
  }}
/>

File Upload With Describable

Demo

import FileUpload from '@hawk-ui/file-upload';
<FileUpload
  btnTitle="Browse"
  label="File Upload"
  description="Supported file types: (*.png, *.jpg, *.jpeg). View format instructions."
  placeholder="Please select a file to Upload"
  variant="input"
  onUpload={(file) => {
    console.log('query file', file);
  }}
/>

On Drag and Drop

Demo

import FileUpload from '@hawk-ui/file-upload';
initialState = {
  fileNames: [],
};

<FileUpload
  content={(
    <>
      <div style={{ fontSize: '16px', fontWeight: '500', color: '#425a70' }}>Drag and Drop Image Here</div>
      <div style={{ fontSize: '12px', color: '#66788a', marginTop: '6px' }}>Supported file types: (*.png, *.jpg, *.jpeg). View format instructions.</div>
    </>
  )}
  title=""
  description=""
  variant="draggable"
  isLoading={false}
  onUpload={(files) => {
    console.log('query files', files);
  }}
/>

Package Sidebar

Install

npm i @hawk-ui/file-upload

Weekly Downloads

76

Version

4.4.1

License

MIT

Unpacked Size

30.2 kB

Total Files

9

Last publish

Collaborators

  • saurabh2112