This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(file-input): update readme to reflect current implementation
- Loading branch information
1 parent
f41327d
commit e3f44f4
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# FileInput | ||
|
||
This is a Button with a hidden file input. When the button is clicked a file dialog appears and when a file is selected, the File instance is passed to the onChange handler. It can be used to build form components with. | ||
This is a `Button` with a hidden file input. When the button is clicked a file dialog appears and when a file is selected, the input's `FileList` instance is passed to the onChange handler. For security reasons, you cannot programmatically set a value to a file input. As a consequence of this, this component is not strictly speaking a "controlled input". There is no `value` prop because you simply cannot set it. | ||
|
||
## FileInput.SelectedFile | ||
|
||
This is a component that can be placed below the `FileInput` to show a list of files that have been selected locally, or have been uploaded before. When the `loading` prop is set to `true`, this component will show a loading icon and a "cancel" link. If `loading` is set to `false`, it will show a paperclip icon and a "remove" link. | ||
|
||
## FileInput.PlaceHolder | ||
|
||
A styled paragraph that you can place below the `FileInput` when no files have been selected yet. |