This repository was archived by the owner on Jan 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,26 @@ Check out the live demo here: http://uptick.github.io/react-keyed-file-browser/
14
14
15
15
Install the package with npm:
16
16
17
- ```
17
+ ``` bash
18
+ # NPM
18
19
npm install react-keyed-file-browser
20
+
21
+ # Yarn
22
+ yarn add react-keyed-file-browser
19
23
```
20
24
21
- Then require and use with ES6 imports:
22
25
23
26
``` javascript
24
27
import React from ' react'
25
28
import ReactDOM from ' react-dom'
26
29
27
30
import FileBrowser from ' react-keyed-file-browser'
28
31
29
- var mount = document .querySelectorAll (' div.browser-mount' );
30
32
ReactDOM .render (
31
33
< FileBrowser
32
34
files= {[]}
33
35
/ > ,
34
- mount[ 0 ]
36
+ document . getElementById ( ' root ' )
35
37
);
36
38
```
37
39
@@ -77,11 +79,18 @@ Optionally, include the built css with an import:
77
79
78
80
``` scss
79
81
@import ' node_modules/react-keyed-file-browser/dist/react-keyed-file-browser.css' ;
80
-
81
82
```
83
+ or tag:
82
84
83
- Optionally, use your own React DND Provider:
85
+ ``` html
86
+ <link
87
+ href =" static/node_modules/react-keyed-file-browser/dist/react-keyed-file-browser.css"
88
+ rel =" stylesheet"
89
+ >
90
+ ```
91
+ ## Examples
84
92
93
+ Using a custom drag and drop provider.
85
94
``` javascript
86
95
import { RawFileBrowser } from ' react-keyed-file-browser'
87
96
@@ -93,14 +102,6 @@ import { HTML5Backend } from 'react-dnd-html5-backend'
93
102
< / DndProvider>
94
103
```
95
104
96
- or tag:
97
-
98
- ``` html
99
- <link
100
- href =" static/node_modules/react-keyed-file-browser/dist/react-keyed-file-browser.css"
101
- rel =" stylesheet"
102
- >
103
- ```
104
105
105
106
Full reference documentation coming soon. For now, take a look at the reference implementation with
106
107
event handlers on the live demo at http://uptick.github.io/react-keyed-file-browser/ .
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-keyed-file-browser" ,
3
- "version" : " 1.13.1 " ,
3
+ "version" : " 1.14.0 " ,
4
4
"description" : " Folder based file browser given a flat keyed list of objects, powered by React." ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments