1.0.3 • Published 6 years ago
@softhem.se/file v1.0.3
File
A React File Component.
Install
You can get it on npm.
npm install @softhem.se/file --save
Usage
import React from 'react';
import '@softhem.se/table.css';
import File from '@softhem.se/File';
function App() {
return (
<div className="App">
<section className="dashboard" id="dashboard">
<div className="dashboard--center">
<div className="row">
<div className="col-1-of-1">
<File/>
</div>
</div>
</div>
</section>
</div>
);
}
export default App;
Props
* The id is the id for the component and must be unique
* accept is the file types that browse dialog box can choose from
* getFiles is the callback function to be called onChange event
File.defaultProps = {
id: 'image_upload',
accept: 'image/x-png,image/gif,image/jpeg',
getFiles: (files) => console.log('You chose these files: ', files)
};
Publish
Prepare
npm run publish:prep
Publish to npm (after login)
npm run publish:npm
License
MIT License © Hazrat Ali