Magoo Component UI logo Magoo Component UI
← Catalog

Donation Amount Picker

donation-amount-picker molecule experimental

A grid of preset donation amount buttons with single selection and an optional custom amount.

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
NoCustom

Props

NameTypeReq
amounts array ✓
allow_custom boolean

Related components

How to use

The static markup renders fully without JavaScript (the pre-selected button comes from data-selected). behavior.js wires single selection: clicking a button selects it, clears the others and any custom value, and dispatches a bubbling "amount:select" CustomEvent whose detail is { amount }; typing in the custom input clears the presets. The portable self-init reads config from data-* attributes, so no props object is passed.

Use cases

formlist-item WCAG AA SEO 20 dir: both ai-generated