dashboard.mdx 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. ---
  2. sidebar_position: 1
  3. slug: /dashboard
  4. ---
  5. import Tabs from '@theme/Tabs';
  6. import TabItem from '@theme/TabItem';
  7. import UppyCdnExample from '/src/components/UppyCdnExample';
  8. # Dashboard
  9. The all you need Dashboard — powerful, responsive, and pluggable. Kickstart your
  10. uploading experience and gradually add more functionality. Add files from
  11. [remote sources](/docs/companion), [edit images](/docs/image-editor),
  12. [generate thumbnails](/docs/thumbnail-generator), and more.
  13. Checkout [integrations](#integrations) for the full list of plugins you can
  14. integrate.
  15. :::tip
  16. [Try out the live example with all plugins](/examples) or take it for a spin in
  17. [CodeSandbox](https://codesandbox.io/s/uppy-dashboard-xpxuhd).
  18. :::
  19. ## When should I use this?
  20. There could be many reasons why you may want to use the Dashboard, but some
  21. could be:
  22. - when you need a battle tested plug-and-play uploading UI to save time.
  23. - when your users need to add files from [remote sources](/docs/companion), such
  24. [Google Drive](/docs/google-drive), [Dropbox](/docs/dropbox), and others.
  25. - when you need to collect [meta data](#metafields) from your users per file.
  26. - when your users want to take a picture with their [webcam](/docs/webcam) or
  27. [capture their screen](/docs/screen-capture).
  28. ## Install
  29. <Tabs>
  30. <TabItem value="npm" label="NPM" default>
  31. ```shell
  32. npm install @uppy/core @uppy/dashboard
  33. ```
  34. </TabItem>
  35. <TabItem value="yarn" label="Yarn">
  36. ```shell
  37. yarn add @uppy/core @uppy/dashboard
  38. ```
  39. </TabItem>
  40. <TabItem value="cdn" label="CDN">
  41. <UppyCdnExample>
  42. {`
  43. import { Uppy, Dashboard } from "{{UPPY_JS_URL}}"
  44. const uppy = new Uppy()
  45. uppy.use(Dashboard, { target: '#uppy', inline: true })
  46. `}
  47. </UppyCdnExample>
  48. </TabItem>
  49. </Tabs>
  50. ## Use
  51. ```js showLineNumbers
  52. import Uppy from '@uppy/core';
  53. import Dashboard from '@uppy/dashboard';
  54. import '@uppy/core/dist/style.min.css';
  55. import '@uppy/dashboard/dist/style.min.css';
  56. new Uppy().use(Dashboard, { inline: true, target: '#uppy-dashboard' });
  57. ```
  58. :::note
  59. The `@uppy/dashboard` plugin includes CSS for the Dashboard itself, and the
  60. various plugins used by the Dashboard, such as
  61. ([`@uppy/status-bar`](/docs/status-bar) and [`@uppy/informer`](/docs/informer)).
  62. If you also use the `@uppy/status-bar` or `@uppy/informer` plugin directly, you
  63. should not include their CSS files, but instead only use the one from the
  64. `@uppy/dashboard` plugin.
  65. :::
  66. :::note
  67. Styles for Provider plugins, like Google Drive and Instagram, are also bundled
  68. with Dashboard styles. Styles for other plugins, such as `@uppy/url` and
  69. `@uppy/webcam`, are not included. If you are using those, please see their docs
  70. and make sure to include styles for them as well.
  71. :::
  72. ## API
  73. ### Options
  74. #### `id`
  75. A unique identifier for this plugin (`string`, default: `'Dashboard'`).
  76. Plugins that are added by the Dashboard get unique IDs based on this ID, like
  77. `'Dashboard:StatusBar'` and `'Dashboard:Informer'`.
  78. #### `target`
  79. Where to render the Dashboard (`string` or `Element`, default: `'body'`).
  80. You can pass an element, class, or id as a string. Dashboard is rendered into
  81. `body`, because it’s hidden by default and only opened as a modal when `trigger`
  82. is clicked.
  83. #### `inline`
  84. Render the Dashboard as a modal or inline (`boolean`, default: `false`).
  85. When `false`, Dashboard is opened by clicking on [`trigger`](#trigger). If
  86. `inline: true`, Dashboard will be rendered into [`target`](#target) and fit
  87. right in.
  88. #### `trigger`
  89. A CSS selector for a button that will trigger opening the Dashboard modal
  90. (`string`, default: `null`).
  91. Several buttons or links can be used, as long as they are selected using the
  92. same selector (`.select-file-button`, for example).
  93. #### `width`
  94. Width of the Dashboard in pixels (`number`, default: `750`). Used when
  95. `inline: true`.
  96. #### `height`
  97. Height of the Dashboard in pixels (`number`, default: `550`). Used when
  98. `inline: true`.
  99. #### `waitForThumbnailsBeforeUpload`
  100. Whether to wait for all thumbnails from `@uppy/thumbnail-generator` to be ready
  101. before starting the upload (`boolean`, default `false`).
  102. If set to `true`, Thumbnail Generator will envoke Uppy’s internal processing
  103. stage, displaying “Generating thumbnails...” message, and wait for
  104. `thumbnail:all-generated` event, before proceeding to the uploading stage.
  105. This is useful because Thumbnail Generator also adds EXIF data to images, and if
  106. we wait until it’s done processing, this data will be available on the server
  107. after the upload.
  108. #### `showLinkToFileUploadResult`
  109. Turn the file icon and thumbnail in the Dashboard into a link to the uploaded
  110. file (`boolean`, default: `false`).
  111. Please make sure to return the `url` key (or the one set via
  112. `responseUrlFieldName`) from your server.
  113. #### `showProgressDetails`
  114. Show or hide progress details in the status bar (`boolean`, default: `false`).
  115. By default, progress in Status Bar is shown as a percentage. If you would like
  116. to also display remaining upload size and time, set this to `true`.
  117. `showProgressDetails: false`: Uploading: 45%
  118. `showProgressDetails: true`: Uploading: 45%・43 MB of 101 MB・8s left
  119. #### `hideUploadButton`
  120. Show or hide the upload button (`boolean`, default: `false`).
  121. Use this if you are providing a custom upload button somewhere, and are using
  122. the `uppy.upload()` API.
  123. #### `hideRetryButton`
  124. Hide the retry button in the status bar and on each individual file (`boolean`,
  125. default: `false`).
  126. Use this if you are providing a custom retry button somewhere and if you are
  127. using the `uppy.retryAll()` or `uppy.retryUpload(fileID)` API.
  128. #### `hidePauseResumeButton`
  129. Hide the pause/resume button (for resumable uploads, via [tus](http://tus.io),
  130. for example) in the status bar and on each individual file (`boolean`, default:
  131. `false`).
  132. Use this if you are providing custom cancel or pause/resume buttons somewhere,
  133. and using the `uppy.pauseResume(fileID)` or `uppy.removeFile(fileID)` API.
  134. #### `hideCancelButton`
  135. Hide the cancel button in status bar and on each individual file (`boolean`,
  136. default: `false`).
  137. Use this if you are providing a custom retry button somewhere, and using the
  138. `uppy.cancelAll()` API.
  139. #### `hideProgressAfterFinish`
  140. Hide the status bar after the upload has finished (`boolean`, default: `false`).
  141. #### `doneButtonHandler`
  142. This option is passed to the status bar and will render a “Done” button in place
  143. of pause/resume/cancel buttons, once the upload/encoding is done. The behaviour
  144. of this “Done” button is defined by this handler function, for instance to close
  145. the file picker modals or clear the upload state.
  146. This is what the Dashboard sets by default:
  147. ```js
  148. const doneButtonHandler = () => {
  149. this.uppy.cancelAll();
  150. this.requestCloseModal();
  151. };
  152. ```
  153. Set to `null` to disable the “Done” button.
  154. #### `showSelectedFiles`
  155. Show the list of added files with a preview and file information (`boolean`,
  156. default: `true`).
  157. In case you are showing selected files in your own app’s UI and want the Uppy
  158. Dashboard to only be a picker, the list can be hidden with this option.
  159. See also [`disableStatusBar`](#disablestatusbar) option, which can hide the
  160. progress and upload button.
  161. #### `showRemoveButtonAfterComplete`
  162. Show the remove button on every file after a successful upload (`boolean`,
  163. default: `false`).
  164. Enabling this option only shows the remove `X` button in the Dashboard UI, but
  165. to actually send a request you should listen to
  166. [`file-removed`](https://uppy.io/docs/uppy/#file-removed) event and add your
  167. logic there.
  168. Example:
  169. ```js
  170. uppy.on('file-removed', (file, reason) => {
  171. if (reason === 'removed-by-user') {
  172. sendDeleteRequestForFile(file);
  173. }
  174. });
  175. ```
  176. For an implementation example, please see
  177. [#2301](https://github.com/transloadit/uppy/issues/2301#issue-628931176).
  178. #### `singleFileFullScreen`
  179. When only one file is selected, its preview and meta information will be
  180. centered and enlarged (`boolean`, default: `true`).
  181. Often times Uppy used for photo / profile image uploads, or maybe a single
  182. document. Then it makes sense to occupy the whole space of the available
  183. Dashboard UI, giving the stage to this one file. This feature is automatically
  184. disabled when Dashboard is small in height, since there’s not enough room.
  185. #### `note`
  186. A string of text to be placed in the Dashboard UI (`string`, default: `null`).
  187. This could for instance be used to explain any [`restrictions`](#restrictions)
  188. that are put in place. For example:
  189. `'Images and video only, 2–3 files, up to 1 MB'`.
  190. #### `metaFields`
  191. Create text or custom input fields for the user to fill in (`Array<Object>` or
  192. `Function`, default: `null`).
  193. This will be shown when a user clicks the “edit” button on that file.
  194. :::note
  195. The meta data will only be set on a file object if it’s entered by the user. If
  196. the user doesn’t edit a file’s metadata, it will not have default values;
  197. instead everything will be `undefined`. If you want to set a certain meta field
  198. to each file regardless of user actions, set
  199. [`meta` in the Uppy constructor options](/docs/uppy/#meta).
  200. :::
  201. Each object can contain:
  202. - `id`. The name of the meta field. This will also be used in CSS/HTML as part
  203. of the `id` attribute, so it’s better to
  204. [avoid using characters like periods, semicolons, etc](https://stackoverflow.com/a/79022).
  205. - `name`. The label shown in the interface.
  206. - `placeholder`. The text shown when no value is set in the field. (Not needed
  207. when a custom render function is provided)
  208. - `render: ({value, onChange, required, form}, h) => void` (optional). A
  209. function for rendering a custom form element.
  210. - `value` is the current value of the meta field
  211. - `onChange: (newVal) => void` is a function saving the new value and `h` is
  212. the `createElement` function from
  213. [Preact](https://preactjs.com/guide/v10/api-reference#h--createelement).
  214. - `required` is a boolean that’s true if the field `id` is in the
  215. `restrictedMetaFields` restriction
  216. - `form` is the `id` of the associated `<form>` element.
  217. - `h` can be useful when using Uppy from plain JavaScript, where you cannot
  218. write JSX.
  219. <details>
  220. <summary>Example: meta fields configured as an `Array`</summary>
  221. ```js
  222. uppy.use(Dashboard, {
  223. trigger: '#pick-files',
  224. metaFields: [
  225. { id: 'name', name: 'Name', placeholder: 'file name' },
  226. { id: 'license', name: 'License', placeholder: 'specify license' },
  227. {
  228. id: 'caption',
  229. name: 'Caption',
  230. placeholder: 'describe what the image is about',
  231. },
  232. {
  233. id: 'public',
  234. name: 'Public',
  235. render({ value, onChange, required, form }, h) {
  236. return h('input', {
  237. type: 'checkbox',
  238. required,
  239. form,
  240. onChange: (ev) => onChange(ev.target.checked ? 'on' : ''),
  241. defaultChecked: value === 'on',
  242. });
  243. },
  244. },
  245. ],
  246. });
  247. ```
  248. </details>
  249. <details>
  250. <summary>Example: dynamic meta fields based on file type with a `Function`</summary>
  251. ```js
  252. uppy.use(Dashboard, {
  253. trigger: '#pick-files',
  254. metaFields: (file) => {
  255. const fields = [{ id: 'name', name: 'File name' }];
  256. if (file.type.startsWith('image/')) {
  257. fields.push({ id: 'location', name: 'Photo Location' });
  258. fields.push({ id: 'alt', name: 'Alt text' });
  259. fields.push({
  260. id: 'public',
  261. name: 'Public',
  262. render: ({ value, onChange, required, form }, h) => {
  263. return h('input', {
  264. type: 'checkbox',
  265. onChange: (ev) => onChange(ev.target.checked ? 'on' : ''),
  266. defaultChecked: value === 'on',
  267. required,
  268. form,
  269. });
  270. },
  271. });
  272. }
  273. return fields;
  274. },
  275. });
  276. ```
  277. </details>
  278. #### `closeModalOnClickOutside`
  279. Set to true to automatically close the modal when the user clicks outside of it
  280. (`boolean`, default: `false`).
  281. #### `closeAfterFinish`
  282. Set to true to automatically close the modal when all current uploads are
  283. complete (`boolean`, default: `false`).
  284. With this option, the modal is only automatically closed when uploads are
  285. complete _and successful_. If some uploads failed, the modal stays open so the
  286. user can retry failed uploads or cancel the current batch and upload an entirely
  287. different set of files instead.
  288. :::info
  289. You can use this together with the
  290. [`allowMultipleUploads: false`](/docs/uppy/#allowmultipleuploads) option in Uppy
  291. Core to create a smooth experience when uploading a single (batch of) file(s).
  292. This is recommended. With several upload batches, the auto-closing behavior can
  293. be quite confusing for users.
  294. :::
  295. #### `disablePageScrollWhenModalOpen`
  296. Disable page scroll when the modal is open (`boolean`, default: `true`).
  297. Page scrolling is disabled by default when the Dashboard modal is open, so when
  298. you scroll a list of files in Uppy, the website in the background stays still.
  299. Set to false to override this behaviour and leave page scrolling intact.
  300. #### `animateOpenClose`
  301. Add animations when the modal dialog is opened or closed, for a more satisfying
  302. user experience (`boolean`, default: `true`).
  303. #### `fileManagerSelectionType`
  304. Configure the type of selections allowed when browsing your file system via the
  305. file manager selection window (`string`, default: `'files'`).
  306. May be either `'files'`, `'folders'`, or `'both'`. Selecting entire folders for
  307. upload may not be supported on all
  308. [browsers](https://caniuse.com/#feat=input-file-directory).
  309. #### `proudlyDisplayPoweredByUppy`
  310. Show the Uppy logo with a link (`boolean`, default: `true`).
  311. Uppy is provided to the world for free by the team behind
  312. [Transloadit](https://transloadit.com). In return, we ask that you consider
  313. keeping a tiny Uppy logo at the bottom of the Dashboard, so that more people can
  314. discover and use Uppy.
  315. #### `disableStatusBar`
  316. Disable the status bar completely (`boolean`, default: `false`).
  317. Dashboard ships with the `StatusBar` plugin that shows upload progress and
  318. pause/resume/cancel buttons. If you want, you can disable the StatusBar to
  319. provide your own custom solution.
  320. #### `disableInformer`
  321. Disable informer (shows notifications in the form of toasts) completely
  322. (`boolean`, default: `false`).
  323. Dashboard ships with the `Informer` plugin that notifies when the browser is
  324. offline, or when it’s time to say cheese if `Webcam` is taking a picture. If you
  325. want, you can disable the Informer and/or provide your own custom solution.
  326. #### `disableThumbnailGenerator`
  327. Disable the thumbnail generator completely (`boolean`, default: `false`).
  328. Dashboard ships with the `ThumbnailGenerator` plugin that adds small resized
  329. image thumbnails to images, for preview purposes only. If you want, you can
  330. disable the `ThumbnailGenerator` and/or provide your own custom solution.
  331. #### `locale`
  332. ```js
  333. module.exports = {
  334. strings: {
  335. // When `inline: false`, used as the screen reader label for the button that closes the modal.
  336. closeModal: 'Close Modal',
  337. // Used as the screen reader label for the plus (+) button that shows the “Add more files” screen
  338. addMoreFiles: 'Add more files',
  339. addingMoreFiles: 'Adding more files',
  340. // Used as the header for import panels, e.g., “Import from Google Drive”.
  341. importFrom: 'Import from %{name}',
  342. // When `inline: false`, used as the screen reader label for the dashboard modal.
  343. dashboardWindowTitle: 'Uppy Dashboard Window (Press escape to close)',
  344. // When `inline: true`, used as the screen reader label for the dashboard area.
  345. dashboardTitle: 'Uppy Dashboard',
  346. // Shown in the Informer when a link to a file was copied to the clipboard.
  347. copyLinkToClipboardSuccess: 'Link copied to clipboard.',
  348. // Used when a link cannot be copied automatically — the user has to select the text from the
  349. // input element below this string.
  350. copyLinkToClipboardFallback: 'Copy the URL below',
  351. // Used as the hover title and screen reader label for buttons that copy a file link.
  352. copyLink: 'Copy link',
  353. back: 'Back',
  354. // Used as the screen reader label for buttons that remove a file.
  355. removeFile: 'Remove file',
  356. // Used as the screen reader label for buttons that open the metadata editor panel for a file.
  357. editFile: 'Edit file',
  358. // Shown in the panel header for the metadata editor. Rendered as “Editing image.png”.
  359. editing: 'Editing %{file}',
  360. // Used as the screen reader label for the button that saves metadata edits and returns to the
  361. // file list view.
  362. finishEditingFile: 'Finish editing file',
  363. saveChanges: 'Save changes',
  364. // Used as the label for the tab button that opens the system file selection dialog.
  365. myDevice: 'My Device',
  366. dropHint: 'Drop your files here',
  367. // Used as the hover text and screen reader label for file progress indicators when
  368. // they have been fully uploaded.
  369. uploadComplete: 'Upload complete',
  370. uploadPaused: 'Upload paused',
  371. // Used as the hover text and screen reader label for the buttons to resume paused uploads.
  372. resumeUpload: 'Resume upload',
  373. // Used as the hover text and screen reader label for the buttons to pause uploads.
  374. pauseUpload: 'Pause upload',
  375. // Used as the hover text and screen reader label for the buttons to retry failed uploads.
  376. retryUpload: 'Retry upload',
  377. // Used as the hover text and screen reader label for the buttons to cancel uploads.
  378. cancelUpload: 'Cancel upload',
  379. // Used in a title, how many files are currently selected
  380. xFilesSelected: {
  381. 0: '%{smart_count} file selected',
  382. 1: '%{smart_count} files selected',
  383. },
  384. uploadingXFiles: {
  385. 0: 'Uploading %{smart_count} file',
  386. 1: 'Uploading %{smart_count} files',
  387. },
  388. processingXFiles: {
  389. 0: 'Processing %{smart_count} file',
  390. 1: 'Processing %{smart_count} files',
  391. },
  392. // The "powered by Uppy" link at the bottom of the Dashboard.
  393. poweredBy: 'Powered by %{uppy}',
  394. addMore: 'Add more',
  395. editFileWithFilename: 'Edit file %{file}',
  396. save: 'Save',
  397. cancel: 'Cancel',
  398. dropPasteFiles: 'Drop files here or %{browseFiles}',
  399. dropPasteFolders: 'Drop files here or %{browseFolders}',
  400. dropPasteBoth: 'Drop files here, %{browseFiles} or %{browseFolders}',
  401. dropPasteImportFiles: 'Drop files here, %{browseFiles} or import from:',
  402. dropPasteImportFolders: 'Drop files here, %{browseFolders} or import from:',
  403. dropPasteImportBoth:
  404. 'Drop files here, %{browseFiles}, %{browseFolders} or import from:',
  405. importFiles: 'Import files from:',
  406. browseFiles: 'browse files',
  407. browseFolders: 'browse folders',
  408. recoveredXFiles: {
  409. 0: 'We could not fully recover 1 file. Please re-select it and resume the upload.',
  410. 1: 'We could not fully recover %{smart_count} files. Please re-select them and resume the upload.',
  411. },
  412. recoveredAllFiles: 'We restored all files. You can now resume the upload.',
  413. sessionRestored: 'Session restored',
  414. reSelect: 'Re-select',
  415. missingRequiredMetaFields: {
  416. 0: 'Missing required meta field: %{fields}.',
  417. 1: 'Missing required meta fields: %{fields}.',
  418. },
  419. },
  420. };
  421. ```
  422. #### `theme`
  423. Light or dark theme for the Dashboard (`string`, default: `'light'`).
  424. Uppy Dashboard supports “Dark Mode”. You can try it live on
  425. [the Dashboard example page](https://uppy.io/examples/).
  426. It supports the following values:
  427. - `light` — the default
  428. - `dark`
  429. - `auto` — will respect the user’s system settings and switch automatically
  430. #### `autoOpen`
  431. Automatically open file editor for the file user just dropped/selected.
  432. If one file is added, editor opens for that file; if 10 files are added, editor
  433. opens only for the first file.
  434. This option supports the following values:
  435. - `null` - the default
  436. - `"metaEditor"` - open the meta fields editor if
  437. [meta fields](/docs/dashboard/#metafields) are enabled.
  438. - `"imageEditor"` - open [`@uppy/image-editor`](/docs/image-editor) if the
  439. plugin is enabled.
  440. #### `disabled`
  441. Enabling this option makes the Dashboard grayed-out and non-interactive
  442. (`boolean`, default: `false`).
  443. Users won’t be able to click on buttons or drop files. Useful when you need to
  444. conditionally enable/disable file uploading or manipulation, based on a
  445. condition in your app. Can be set on init or via API:
  446. ```js
  447. const dashboard = uppy.getPlugin('Dashboard');
  448. dashboard.setOptions({ disabled: true });
  449. userNameInput.addEventListener('change', () => {
  450. dashboard.setOptions({ disabled: false });
  451. });
  452. ```
  453. #### `disableLocalFiles`
  454. Disable local files (`boolean`, default: `false`).
  455. Enabling this option will disable drag & drop, hide the “browse” and “My Device”
  456. button, allowing only uploads from plugins, such as Webcam, Screen Capture,
  457. Google Drive, Instagram.
  458. #### `onDragOver(event)`
  459. Callback for the [`ondragover`][ondragover] event handler.
  460. #### `onDrop(event)`
  461. Callback for the [`ondrop`][ondrop] event handler.
  462. #### `onDragLeave(event)`
  463. Callback for the [`ondragleave`][ondragleave] event handler.
  464. ### Methods
  465. :::info
  466. Dashboard also has the methods described in
  467. [`UIPlugin`](/docs/uppy#new-uipluginuppy-options) and
  468. [`BasePlugin`](/docs/uppy#new-basepluginuppy-options).
  469. :::
  470. #### `openModal()`
  471. Shows the Dashboard modal. Use it like this:
  472. `uppy.getPlugin('Dashboard').openModal()`
  473. #### `closeModal()`
  474. Hides the Dashboard modal. Use it like this:
  475. `uppy.getPlugin('Dashboard').closeModal()`
  476. #### `isModalOpen()`
  477. Returns `true` if the Dashboard modal is open, `false` otherwise.
  478. ```js
  479. const dashboard = uppy.getPlugin('Dashboard');
  480. if (dashboard.isModalOpen()) {
  481. dashboard.closeModal();
  482. }
  483. ```
  484. ### Events
  485. :::info
  486. You can use [`on`](/docs/uppy#onevent-action) and
  487. [`once`](/docs/uppy#onceevent-action) to listen to these events.
  488. :::
  489. #### `dashboard:modal-open`
  490. Fired when the Dashboard modal is open.
  491. ```js
  492. uppy.on('dashboard:modal-open', () => {
  493. console.log('Modal is open');
  494. });
  495. ```
  496. #### `dashboard:modal-closed`
  497. Fired when the Dashboard modal is closed.
  498. #### `dashboard:file-edit-start`
  499. **Parameters:**
  500. - `file` — The [File Object](https://uppy.io/docs/uppy/#File-Objects)
  501. representing the file that was opened for editing.
  502. Fired when the user clicks “edit” icon next to a file in the Dashboard. The
  503. FileCard panel is then open with file metadata available for editing.
  504. #### `dashboard:file-edit-complete`
  505. **Parameters:**
  506. - `file` — The [File Object](https://uppy.io/docs/uppy/#File-Objects)
  507. representing the file that was edited.
  508. Fired when the user finished editing the file metadata.
  509. ## Integrations
  510. These are the plugins specifically made for the Dashboard. This is not a list of
  511. all Uppy plugins.
  512. ### Sources
  513. - [`@uppy/audio`](/docs/audio) — record audio.
  514. - [`@uppy/box`](/docs/box) — import files from
  515. [Box](https://www.box.com/en-nl/home).
  516. - [`@uppy/dropbox`](/docs/dropbox) — import from [Dropbox](https://dropbox.com).
  517. - [`@uppy/facebook`](/docs/facebook) — import from
  518. [Facebook](https://facebook.com).
  519. - [`@uppy/google-drive`](/docs/google-drive) — import from
  520. [Google Drive](https://drive.google.com).
  521. - [`@uppy/instagram`](/docs/instagram) — import from
  522. [Instagram](https://instagram.com).
  523. - [`@uppy/onedrive`](/docs/onedrive) — import from
  524. [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage).
  525. - [`@uppy/screen-capture`](/docs/screen-capture) — Record your screen, including
  526. (optionally) your microphone.
  527. - [`@uppy/unsplash`](/docs/unsplash) — import files from
  528. [Unsplash](https://unsplash.com/)
  529. - [`@uppy/url`](/docs/url) — import files from any URL.
  530. - [`@uppy/webcam`](/docs/webcam) — Record or make a picture with your webcam.
  531. - [`@uppy/zoom`](/docs/zoom) — import files from [Zoom](https://zoom.us).
  532. ### UI
  533. - [`@uppy/image-editor`](/docs/image-editor) — allows users to crop, rotate,
  534. zoom and flip images that are added to Uppy.
  535. - [`@uppy/informer`](/docs/informer) — show notifications.
  536. - [`@uppy/status-bar`](/docs/status-bar) — advanced upload progress status bar.
  537. - [`@uppy/thumbnail-generator`](/docs/thumbnail-generator) — generate preview
  538. thumbnails for images to be uploaded.
  539. ### Frameworks
  540. - [`@uppy/angular`](/docs/angular) — Dashboard component for
  541. [Angular](https://angular.io/).
  542. - [`@uppy/react`](/docs/react) — Dashboard component for
  543. [React](https://reactjs.org/).
  544. - [`@uppy/svelte`](/docs/svelte) — Dashboard component for
  545. [Svelte](https://svelte.dev/).
  546. - [`@uppy/vue`](/docs/vue) — Dashboard component for [Vue](https://vuejs.org/).
  547. [ondragover]:
  548. https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/ondragover
  549. [ondragleave]:
  550. https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/ondragleave
  551. [ondrop]:
  552. https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/ondrop