{"id":13798228,"url":"https://github.com/falconshark/hologram-image-upload","last_synced_at":"2025-05-13T05:31:47.787Z","repository":{"id":57264887,"uuid":"83784719","full_name":"falconshark/hologram-image-upload","owner":"falconshark","description":"React image uploader with dropzone and cropper function","archived":false,"fork":false,"pushed_at":"2019-09-24T08:37:28.000Z","size":1143,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T19:01:55.371Z","etag":null,"topics":["crop","dropzone","html5","image-upload","react"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/falconshark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-03T10:03:39.000Z","updated_at":"2025-03-21T20:02:15.000Z","dependencies_parsed_at":"2022-08-25T03:40:30.749Z","dependency_job_id":null,"html_url":"https://github.com/falconshark/hologram-image-upload","commit_stats":null,"previous_names":["falconshark/hologram-image-upload","dollars0427/hologram-image-upload"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconshark%2Fhologram-image-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconshark%2Fhologram-image-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconshark%2Fhologram-image-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconshark%2Fhologram-image-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/falconshark","download_url":"https://codeload.github.com/falconshark/hologram-image-upload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253883119,"owners_count":21978611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crop","dropzone","html5","image-upload","react"],"created_at":"2024-08-04T00:00:40.685Z","updated_at":"2025-05-13T05:31:47.222Z","avatar_url":"https://github.com/falconshark.png","language":"JavaScript","funding_links":[],"categories":["Javascript"],"sub_categories":[],"readme":"# Hologram Image Upload\n\nReact image uploader with dropzone and cropper function, which used [React Dropzone](https://github.com/okonet/react-dropzone) and [React Image Crop](https://github.com/DominicTobias/react-image-crop).\n\nYou can please feel free to open issues or pull request.\n\n[![npm]( \thttp://img.shields.io/npm/v/npm.svg)](https://www.npmjs.com/package/hologram-image-upload)\n\n## Demo\nhttps://hologram.sardo.work/\n\n## Features\n- Using dropzone to upload multiple image files\n- Crop and preview image  \n\n## Browser Support\n- Latest Firefox\n- Latest Chrome\n- IE 11 and Edge\n\n## Installation\n```bash\nnpm install hologram-image-upload --save\n```\n\n## Usage\n```js\nimport Hologram from 'hologram-image-upload';\n```\n\nAfter version 2.5, you will not need require any css file now.\n\n## Props\n\n#### defaultFiles (optional)\nMockup images of dropzone. You could pass the name, url, and type of file, then it will be add to dropzone when Hologram mounted.\n\n```jsx\n\u003cHologram defaultFiles={[{name: 'dummy.jpg', url: 'https://s3-ap-southeast-1.amazonaws.com/dummy/dummy.jpg', type: 'image/jpeg'}]}/\u003e\n```\n\n#### uploader (optional)\nThe post url of your upload handler. You need to pass this prop or a custom upload function for everything to work.\n\n```jsx\n\u003cHologram uploader=\"upload.php\"/\u003e\n```\n\n#### maxFiles (optional)\nIf files more than this number, it will not be uploaded. However, if number is -1, user will be allow to upload unlimited number of image. Default Number is -1.\n\n```js\nvar maxFiles = 10;\n\u003cHologram uploader=\"upload.php\" maxFiles={maxFiles}/\u003e\n```\n\n#### Custom Upload Function (optional)\nIf you want, you can pass in your custom upload function as a prop. The function takes two arguments: The file information and the actual file data. This function MUST return a promise\n\n\n```jsx\nmyUploadFunc(file, data) {\n  return new Promise((resolve, reject) =\u003e {\n    // FANCY TASKS HERE\n    // do this and this and this\n    // END OF FANCY TASKS\n    request.post(FANCY_URL).send(MY_FANCY_DATA).end((err, res) =\u003e{\n      if (err) return reject(err)\n      resolve(res)\n    });\n  });\n}\n\n\u003cHologram uploadFunction={this.myUploadFunc.bind(this)} \u003e\u003c/Hologram\u003e\n```\n\n#### dropzoneConfig (optional)\nConfig of React Dropzone.\nhttps://github.com/okonet/react-dropzone\n\n```jsx\nvar dropzoneConfig = {\n            style : {\n                textAlign: 'center',\n                padding: '2.5em 0',\n                background: 'rgba(0,0,0,0.5)',\n                color: '#fff'\n            }\n    }\n\n\u003cHologram uploader=\"upload.php\" dropzoneConfig={dropzoneConfig}/\u003e\n```\n\n\n#### cropperConfig (optional)\nConfig of React Image Crop.\nhttps://github.com/DominicTobias/react-image-crop\n\n```jsx\nvar crop = {\n\tx: 20,\n\ty: 10,\n}\n\n\u003cHologram uploader=\"upload.php\" cropperConfig={crop} /\u003e\n```\n\n#### onComplete(result) (optional)\nCallback function which trigger when image uploaded.\nIt will pass a object which contain http response, you can use it to handler the result of upload.  \n\n## Contributing\n\nYou can clone this repository then start develop at sandbox, or feel free to open issue on github.\n\nBuild package:\n\n```bash\nnpm run build\n```\n\nWatch package change and build it:\n\n```bash\nnpm run watch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalconshark%2Fhologram-image-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalconshark%2Fhologram-image-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalconshark%2Fhologram-image-upload/lists"}