Made to order
Playground
Build your tip button and copy the code. Everything here changes the real button on this page: look for it in the corner, and scroll to the footer to watch it step aside.
Examples
Try one to put it in the corner of this page. The arrow takes it down to the builder, where you can change anything.
The regular
A pixel coffee cup and one link to Ko-fi. This page’s own button.
The full menu
One button that opens a list: a coffee, and a star on GitHub with its count.
Sponsor heart
A beating heart for GitHub Sponsors, with a shine on hover.
Buy me a slice
Top left, outlined pizza, pops in when the page loads.
The quiet one
Just the icon until you hover, then it opens to its label.
In the page
Not floating at all: it sits in your text, with a nudge after a while.
Build your own
Four tabs of options. The code beside them keeps up as you go.
Use it
The code for the button above. Only what you changed from the defaults is written out.
import { mount } from 'tipjar';
import 'tipjar/style.css';
mount({
href: 'https://ko-fi.com/mtblck',
description: 'Matt Black\'s work on Ko-fi',
icon: 'coffee',
iconStyle: 'pixel',
newTab: true,
hideWhenVisible: 'footer',
});Colors and the icon’s size go in your stylesheet, not in the call, so the button works under a strict content security policy.
New in 2.3
Ask once
supportPrompt() asks for support one time, once someone has spent a while with your work: from their second visit, after 30 seconds and a quarter of the page, never while they’re typing. Close it and it stays closed. It’s opt-in, and a separate stylesheet, so the button costs nothing extra without it.
import { supportPrompt } from 'tipjar';
import 'tipjar/style.css';
import 'tipjar/prompt.css';
supportPrompt({
links: [
{ href: 'https://ko-fi.com/you', label: 'Buy me a coffee', icon: 'coffee' },
{ href: 'https://github.com/you/project', label: 'Star it on GitHub', icon: 'star' },
],
});When it shows is yours to set: delay, scroll, pageViews and cooldownDays are in the API reference.