diff --git a/Makefile b/Makefile index 660a7c0..2508a28 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ CSS_FILES = src/css/00-base.css \ src/css/tabs.css \ src/css/dialog.css \ src/css/dropdown.css \ + src/css/file-drop.css \ src/css/toast.css \ src/css/sidebar.css \ src/css/skeleton.css \ diff --git a/docs/content/components/file-drop.md b/docs/content/components/file-drop.md new file mode 100644 index 0000000..cff9517 --- /dev/null +++ b/docs/content/components/file-drop.md @@ -0,0 +1,32 @@ ++++ +title = "File Drop" +weight = 85 +description = "Dropzone-style file picker with drag and drop support." + +[extra] +webcomponent = true ++++ + +Use `` to let users drag files onto a target or click it to open the native file picker. Add `multiple` to accept more than one file and `accept` to restrict MIME types or extensions, just like ``. + +{% demo() %} + +```html + + + Drop images here + or click to browse PNG, JPG, GIF, or WebP files + + + + +``` + +{% end %} + +The component dispatches `ot-file-drop` with `{ files, accepted, rejected }` whenever files are selected or dropped. diff --git a/docs/templates/demo.html b/docs/templates/demo.html index e82b66d..d49d537 100644 --- a/docs/templates/demo.html +++ b/docs/templates/demo.html @@ -541,6 +541,30 @@

Account Settings

+
+ + + + Drop images or PDFs here + or click to browse multiple files + + + No files selected. + +
+