Skip to content

Commit 2a4bdbd

Browse files
committed
Add documentation for optional attributes
1 parent b762d66 commit 2a4bdbd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ import '@github/file-attachment-element'
1515
```
1616

1717
```html
18-
<file-attachment directory>
18+
<file-attachment directory input="upload">
19+
<input id="upload" type="file" multiple>
1920
</file-attachment>
2021
```
2122

23+
### Optional attributes
24+
25+
- `file-attachment[directory]` enables traversing directories.
26+
- `file-attachment[input]` points to the ID of a file input inside of `<file-attachment>`. Files selected from the `<input>` will be attached to `<file-attachment>`. Supplying an input is strongly recommended in order to ensure users can upload files without a mouse or knowing where to paste files.
27+
2228
### Styling drag state
2329

2430
A boolean `[hover]` attribute is present on `<file-attachment>` while files are dragged over the element.

0 commit comments

Comments
 (0)