You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
Box UI Elements are pre-built UI components that allow developers to add features of the main Box web application into their own applications. They can be used to navigate through, upload, preview, and select content stored on Box and are available both as React components and framework-agnostic JavaScript libraries.
10
10
11
11
# Usage
12
-
The instructions below describe how to use the UI Elements in a [React](https://facebook.github.io/react) application. If instead you would like to include the framework-agnostic libraries as scripts, refer to our [developer documentation](https://developer.box.com/docs/box-ui-elements). Continue reading below for how to import the UI Elements as React components. You can also reference https://github.com/box/box-ui-elements-demofor a minimal React application using the Explorer UI Element.
12
+
The instructions below describe how to use the UI Elements in a [React](https://facebook.github.io/react) application. If instead you would like to include the framework-agnostic libraries as scripts, refer to our [developer documentation](https://developer.box.com/docs/box-ui-elements). Continue reading below for how to import the UI Elements as React components. You can also reference https://github.com/box/box-ui-elements-demoor https://github.com/box/box-content-preview-demo for minimal React applications using the Explorer UI Element and Preview UI Element respectively.
13
13
14
14
## Installation
15
15
`yarn add box-ui-elements` or `npm install box-ui-elements`
***The Box Content Preview has a slightly different interface than the other components. Instead of importing localizations like the examples above, it requires a locale (defaults to en-US) to be passed in. This will automatically pull in the corresponding preview bundle and dynamically load it. It will also dynamically load the required CSS file.***
222
+
***The Box Content Preview has a slightly different interface than the other components. Instead of importing localizations like in the examples above, it requires a locale (defaults to en-US) to be passed in. This will automatically pull in the corresponding preview bundle and dynamically load it. It will also dynamically load the additional required CSS file needed for preview.***
223
223
224
224
```js
225
225
importReactfrom'react';
226
226
import { render } from'react-dom';
227
227
import { ContentPreview } from'box-ui-elements';
228
+
import'box-ui-elements/dist/preview.css';
228
229
229
230
consttoken='ACCESS_TOKEN';
230
231
constfileId='FILE_ID';
@@ -241,15 +242,17 @@ render(
241
242
### Props
242
243
| Prop | Type | Default | Description |
243
244
| --- | --- | --- | --- |
244
-
| token*| string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).*|
245
+
| token*| string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
245
246
| fileId*| string || The id of the file to preview. |
246
247
| locale | string |`en-US`| Locale for this component. |
247
248
| onLoad | function || Callback function for when a file preview loads. |
248
-
| collection | Array<string>|`[]`|*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).*|
249
-
| header | string |`light`|*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).*|
250
-
| logoUrl | string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).*|
251
-
| sharedLink | string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).*|
252
-
| sharedLinkPassword | string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).*|
249
+
| collection | Array<string>|`[]`|*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
250
+
| showAnnotations | boolean | false |*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
251
+
| showDownload | boolean | false |*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
252
+
| header | string |`light`|*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
253
+
| logoUrl | string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
254
+
| sharedLink | string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
255
+
| sharedLinkPassword | string ||*See the [developer docs](https://developer.box.com/docs/box-content-preview#section-options).*|
0 commit comments