An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# svelte-code-copy

npm-version npm-license npm-download-month npm-min-size ci.yml website

❏ 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)