Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sveltemeacoffee

skamansam110.0.1TypeScript support: included

Fully Configurable Buy Me A Coffee button in svelte

svelte, buymeacoffee, coffee, buy me a coffee

readme

sveltemeacoffee

Fully Configurable Buy Me A Coffee button in svelte

Why does this exist?

When trying to use the Buy Me A Coffee button, I noticed there are a few things wrong with the buttons you can create:

  1. There are only a handful of colored images to choose from.
  2. If you try to use a custom color or text, you can't get an image link for that custom value.
  3. If you try to use the script code they give you, it fails in Svelte/Kit (and maybe Nuxt, etc, as well)with the following error:

    Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

Options:

There are SVG images in the BMAC creator kit, so I used those to create a SVG image of the button and used the svg translate() for scaling.

Defaults: