Prechádzať zdrojové kódy

docs: Add FileInput docs page.

Renée Kooi 7 rokov pred
rodič
commit
d836289aff
2 zmenil súbory, kde vykonal 49 pridanie a 1 odobranie
  1. 48 0
      website/src/docs/fileinput.md
  2. 1 1
      website/src/docs/plugins.md

+ 48 - 0
website/src/docs/fileinput.md

@@ -0,0 +1,48 @@
+---
+type: docs
+order: 25
+title: "FileInput"
+permalink: docs/fileinput/
+---
+
+`FileInput` is the most barebones UI for selecting files—it shows a single button that, when clicked, opens up the browser's file selector.
+
+[Try it live](/examples/xhrupload) - The XHRUpload example uses a `FileInput`.
+
+## Options
+
+```js
+uppy.use(FileInput, {
+  target: '.UppyForm',
+  getMetaFromForm: true,
+  replaceTargetContent: true,
+  multipleFiles: true,
+  pretty: true,
+  locale: {
+    strings: {
+      selectToUpload: 'Select to upload'
+    }
+  },
+  inputName: 'files[]'
+})
+```
+
+### `target: null`
+
+DOM element, CSS selector, or plugin to mount the file input into.
+
+### `multipleFiles: true`
+
+Whether to allow the user to select multiple files at once.
+
+### `pretty: true`
+
+When true, display a styled button (see [example](/examples/xhrupload)) that, when clicked, opens the file selector UI. When false, a plain old browser `<input type="file">` element is shown.
+
+### `inputName: 'files[]'`
+
+The `name` attribute for the `<input type="file">` element.
+
+### `locale: {}`
+
+Custom text to show on the button when `pretty` is true. There is only one string that can be configured: `strings.selectToUpload`.

+ 1 - 1
website/src/docs/plugins.md

@@ -10,7 +10,7 @@ Plugins are what makes Uppy useful: they help select, manipulate and upload file
 - **Acquirers (neat UIs for picking files):**
 - **Acquirers (neat UIs for picking files):**
   - [Dashboard](/docs/dashboard) — full featured sleek UI with file previews, metadata editing, upload/pause/resume/cancel buttons and more
   - [Dashboard](/docs/dashboard) — full featured sleek UI with file previews, metadata editing, upload/pause/resume/cancel buttons and more
   - [DragDrop](/docs/dragdrop) — plain and simple drag and drop area
   - [DragDrop](/docs/dragdrop) — plain and simple drag and drop area
-  - FileInput — even more plain and simple, just a button
+  - [FileInput](/docs/fileinput) — even more plain and simple, just a button
   - [Provider Plugins](#Provider-Plugins) (remote sources that work through [Uppy Server](/docs/uppy-server/)): Instagram, GoogleDrive, Dropbox
   - [Provider Plugins](#Provider-Plugins) (remote sources that work through [Uppy Server](/docs/uppy-server/)): Instagram, GoogleDrive, Dropbox
 - **Uploaders:**
 - **Uploaders:**
   - [Tus](/docs/tus) — uploads using the [tus](https://tus.io) resumable upload protocol
   - [Tus](/docs/tus) — uploads using the [tus](https://tus.io) resumable upload protocol