Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prop for the text within the dropzone #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,21 @@ yarn add svelte-file-dropzone

### Props

| Prop Name | Description | Default Value |
| --------------------- | ---------------------------------------------------------------------------------------- | ------------- |
| accept | Set accepted file types. See https://github.com/okonet/attr-accept for more information. | undefined |
| disabled | | false |
| maxSize | | Infinity |
| minSize | | 0 |
| multiple | if true, multiple files can be selected at once | true |
| preventDropOnDocument | 1231 | true |
| noClick | disable click events | false |
| noKeyboard | disable keyboard events | false |
| noDrag | disable drag events | false |
| containerClasses | custom container classes | "" |
| containerStyles | custom inline container styles | "" |
| disableDefaultStyles | don't apply default styles to container | false |
| Prop Name | Description | Default Value |
| --------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| accept | Set accepted file types. See https://github.com/okonet/attr-accept for more information. | undefined |
| disabled | | false |
| maxSize | | Infinity |
| minSize | | 0 |
| multiple | if true, multiple files can be selected at once | true |
| preventDropOnDocument | 1231 | true |
| noClick | disable click events | false |
| noKeyboard | disable keyboard events | false |
| noDrag | disable drag events | false |
| containerClasses | custom container classes | "" |
| containerStyles | custom inline container styles | "" |
| containerText | customize the default text in the container | "Drag 'n' drop some files here, or click to select files" |
| disableDefaultStyles | don't apply default styles to container | false |

### Events

Expand Down
3 changes: 2 additions & 1 deletion src/components/Dropzone.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
export let noDragEventsBubbling = false;
export let containerClasses = "";
export let containerStyles = "";
export let containerText = "Drag 'n' drop some files here, or click to select files";
export let disableDefaultStyles = false;
export let name = "";
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -352,6 +353,6 @@
bind:this={inputRef}
style="display: none;" />
<slot>
<p>Drag 'n' drop some files here, or click to select files</p>
<p>{containerText}</p>
</slot>
</div>