Magoo Component UI logo Magoo Component UI
← Catalog

Donation Form

donation-form organism experimental

A donation panel with preset amount buttons, a custom amount, a one-time/monthly toggle, and a Donate button.

Also in: Forms

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
Monthly

Props

NameTypeReq
amounts array ✓
frequency enum (one-time | monthly)
currency string

Related components

How to use

The static markup renders fully without JavaScript (the selected preset and the active toggle side come from data-selected and the group data-frequency attribute). behavior.js wires interaction: clicking a preset selects it and clears any custom amount; typing a custom amount clears the presets; the toggle updates data-frequency (driving the highlight) and aria-pressed; Donate dispatches a bubbling "donate:submit" CustomEvent whose detail is { amount, frequency }. The portable self-init reads all config from data-* attributes, so no props object is passed.

Use cases

formhighlight WCAG AA SEO 30 dir: both ai-generated