StealThis .dev

Nonprofit — Donation Widget

A warm, conversion-minded donation widget for charities and nonprofits. Preset amount chips with a custom-amount input, a one-time versus monthly frequency toggle, live impact-equivalence copy that changes per gift size, an optional cover-the-fee checkbox, a campaign progress thermometer, donor recognition, and trust badges. The donate button label updates to reflect the running total and frequency, and a toast confirms each gift, all in self-contained vanilla HTML, CSS, and JavaScript.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Donation Widget

A reusable, drop-in donation panel built for the warm, hopeful tone of a clean-water charity. A mission column carries an impact photo, a registered-charity trust badge, headline impact numbers, and a fundraising thermometer; the giving column holds the actual ask. Five preset amount chips ($25–$500) sit alongside a custom-amount field, and a pill toggle switches between one-time and monthly gifts.

The widget reacts in real time. Selecting a chip or typing a custom amount rewrites the impact-equivalence line — “one month of clean water for a family of five,” “an entire borehole well for a community of 250” — and that copy adapts to whether the donor chose one-time or monthly. The donate button always shows the current total and frequency, an optional checkbox adds 3% to cover processing fees, and submitting fires a thank-you toast while prepending the gift to a live donor-recognition list.

Everything is vanilla JS with no dependencies: keyboard-usable buttons and inputs, aria-live impact updates, AA-contrast colors, and a layout that collapses cleanly down to 360px. Swap the org name, amounts, and impact tiers to fit any campaign.

Illustrative UI only — fictional organization, not a real charity or donation system.