@hawk-ui/file-upload
v4.4.1
Published
hawk-ui: File Upload Component
Downloads
332
Maintainers
Readme
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:
import FileUpload from '@hawk-ui/file-upload';
<FileUpload
btnTitle="Browse"
accept="images/*"
isMultiple
onUpload={(file) => {
console.log('query file', file);
}}
/>
File Upload With Icon
import FileUpload from '@hawk-ui/file-upload';
<FileUpload
btnIcon="fas fa-upload"
onUpload={(file) => {
console.log('query file', file);
}}
/>
File Upload With Describable
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
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);
}}
/>