Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
chore(file-input): update readme to reflect current implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric authored and varl committed Nov 20, 2019
1 parent f41327d commit e3f44f4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion stories/info/atoms/fileInput.md
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.

0 comments on commit e3f44f4

Please sign in to comment.