Download js/app/src/api_docs/CopyButton.svelte from mindmime/gradio: direct link, hf CLI and curl.
- Browser
- Download file 342 Bytes
-
https://huggingface.co/spaces/mindmime/gradio/resolve/main/js/app/src/api_docs/CopyButton.svelte
- Command line
-
hf download hf://spaces/mindmime/gradio/js/app/src/api_docs/CopyButton.svelte
-
curl -L -o CopyButton.svelte https://huggingface.co/spaces/mindmime/gradio/resolve/main/js/app/src/api_docs/CopyButton.svelte
342 Bytes
| <script lang="ts"> | |
| import { BaseButton } from "@gradio/button"; | |
| export let code: string; | |
| let copy_text = "copy"; | |
| function copy(): void { | |
| navigator.clipboard.writeText(code); | |
| copy_text = "copied!"; | |
| setTimeout(() => { | |
| copy_text = "copy"; | |
| }, 1500); | |
| } | |
| </script> | |
| <BaseButton size="sm" on:click={copy}> | |
| {copy_text} | |
| </BaseButton> | |