mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs(file-uploader): improve FileUploader
documentation (#1126)
- add `FileUploader` "Clear files" example - document `validateFiles` prop for `FileUploaderDropContainer` - add descriptions for `FileUploaderButton`, `FileUploader` examples
This commit is contained in:
parent
78072a1c66
commit
44d848c60d
2 changed files with 70 additions and 2 deletions
|
@ -0,0 +1,32 @@
|
|||
<script>
|
||||
import { FileUploader, Button } from "carbon-components-svelte";
|
||||
|
||||
let fileUploader;
|
||||
let files = [];
|
||||
</script>
|
||||
|
||||
<FileUploader
|
||||
bind:this="{fileUploader}"
|
||||
multiple
|
||||
labelTitle="Upload files"
|
||||
buttonLabel="Add files"
|
||||
status="complete"
|
||||
bind:files
|
||||
/>
|
||||
|
||||
<br />
|
||||
|
||||
<Button
|
||||
kind="tertiary"
|
||||
disabled="{!files.length}"
|
||||
on:click="{fileUploader.clearFiles}"
|
||||
>
|
||||
Clear (programmatic)
|
||||
</Button>
|
||||
<Button
|
||||
kind="tertiary"
|
||||
disabled="{!files.length}"
|
||||
on:click="{() => (files = [])}"
|
||||
>
|
||||
Clear (two-way binding)
|
||||
</Button>
|
Loading…
Add table
Add a link
Reference in a new issue