thecodejack / svelte-file-dropzone

Svelte component for fileupload
https://svelte-file-dropzone.netlify.app/
252 stars 45 forks source link

how do you change the text Drag 'n' drop some files here, or click to select files #142

Closed craigcosmo closed 1 year ago

craigcosmo commented 1 year ago

the default text, how do you change it to something else?

Drag 'n' drop some files here, or click to select files

sho13 commented 1 year ago

@craigcosmo the Dropzone component includes a <slot /> element - https://github.com/thecodejack/svelte-file-dropzone/blob/master/src/lib/components/Dropzone.svelte#L364-L366

in case you haven't heard of the <slot /> element you can read more here

TLDR; all you need to do is have Dropzone wrap around whatever you want to replace the text with.

<Dropzone>
  <p>Replace default text</p>
</Dropzone