https://github.com/jill64/svelte-code-copy
❏ Just wrap it with this
https://github.com/jill64/svelte-code-copy
button code-block copy html svelte
Last synced: about 1 year ago
JSON representation
❏ Just wrap it with this
- Host: GitHub
- URL: https://github.com/jill64/svelte-code-copy
- Owner: jill64
- License: mit
- Created: 2023-12-11T03:47:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-22T09:30:28.000Z (about 2 years ago)
- Last Synced: 2023-12-22T10:57:43.941Z (about 2 years ago)
- Topics: button, code-block, copy, html, svelte
- Language: Svelte
- Homepage: https://svelte-code-copy.jill64.dev
- Size: 414 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# svelte-code-copy
❏ Just wrap it with this
## [Demo](https://svelte-code-copy.jill64.dev)
## Installation
```bash
npm i svelte-code-copy
```
## Usage
`pre` is optional.
`` copies the `innerText` of ``
```svelte
import { CodeCopy } from 'svelte-code-copy'
```
## Props
[full details](./src/lib//CodeCopy.svelte)
| Prop | Type | Default |
| ------------ | ---------- | ------------- |
| onCopy | `function` | `undefined` |
| size | `number` | 18 |
| background | `string` | `transparent` |
| color | `string` | `whitesmoke` |
| success | `string` | `green` |
| error | `string` | `red` |
| top | `string` | 0.5rem |
| right | `string` | 0.5rem |
| border | `string` | `none` |
| padding | `string` | 0.25rem |
| borderRadius | `string` | 0.25rem |
| margin | `string` | 0 |
| effect | `string` | `pop` |
| duration | `number` | 150 |
## License
[MIT](LICENSE)