Magoo Component UI logo Magoo Component UI
← Catalog

Referral Invite

referral-invite molecule experimental

A card inviting a member to share a referral code for a bonus, with one-click copy.

Also in: Cards

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

Give $10, get $10

Share your code - you both earn once your friend makes a first order.

MAGOO-8F3K

4 friends joined

NoReferrals

Invite friends, earn 500 points each

Send your link. When a friend joins and orders, you both get points.

https://magoo.example/r/8F3K

4 friends joined

Props

NameTypeReq
bonus string
placeholder string
code string
referred_count string

Related components

How to use

behavior.js wires the copy action. On click it copies the button's data-copy value to the clipboard (with a textarea fallback where the Clipboard API is unavailable), swaps the label from data-label-default to data-label-copied for about 1.6 seconds, and dispatches a bubbling "referral:copied" event with the code in event.detail. The portable self-init reads all config from the button's data-* attributes - no props object is passed. The cleanup removes the listener and clears the pending label-reset timer.

Use cases

highlightcard WCAG AA SEO 40 dir: both ai-generated