mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
28 lines
512 B
Svelte
28 lines
512 B
Svelte
<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>
|