shadcn.io is not affiliated with official shadcn/ui
Referral Program Settings Block for React
A referral program panel with the rule as a sentence with number and unit slots, a three tier bonus ladder, a calculator slider from 0 to 40 friends and a validated referral code with a copyable link.
Installation
Overview
Set what a friend gets, what the person who brought them earns, and the code they share, with this referral program panel for React with Base UI. Inside a hairline frame with a plus mark on each corner, the rule is a sentence with slots: a Number Input and a Native Select for the friend's discount (percent or dollars off the first box) and a Number Input for the free months the referrer earns when the friend's second box ships, with a line that works the sentence out on a sample box. Under it a bonus ladder of three cells on shared hairlines (3 referrals: 1 free month, 10: 3 free months, 25: a free year) lights the tiers a calculator reaches. The calculator is a Slider from 0 to 40 friends with a sentence that sums the free months from the rule and from the ladder; it is not saved. The last band has the referral code in an Input, which takes letters, numbers and hyphens up to 12 characters, and the link it makes in a read-only field with a Copy Button. A status line counts unsaved changes beside a Shine Button to save them and an outline Button to discard them. It's built from Number Input, Native Select, Slider, Input, Copy Button, Button, Shine Button and Guides, with a CSS entrance only. For meal kits, subscription boxes, apps with invitations and any product that pays for word of mouth.
FAQ
How do I change the tiers, the unit or the sample box?
TIERS lists the ladder (the number of referrals, the label and the months it adds), BOX is the sample first box in dollars that the sentence is worked out on, and rangeOf holds what the discount and the months may be (5 to 50 percent, 5 to 30 dollars, 1 to 3 months). The ladder cells, the calculator and the sum are all read from TIERS.
How does the calculator add things up?
Friends times the months per friend from the rule, plus the months of every tier the number reaches. A tier shows Reached or how many more friends it needs, in words as well as in the solid bar along its top, and the sentence under the slider spells out both parts and the total. The slider is named, announces its value in friends and is not part of the saved settings.
What does the code accept?
Letters, numbers and hyphens, at least 4 and at most 12 characters. A code that breaks that shows the reason on the line under the field and in the field's description, the link below keeps the last typed text, Copy declines while the code is invalid, and Save is refused with focus on the field.
What stays local, and how do I wire it for real?
Everything: nobody is paid, the link opens nothing and the copy goes to your own clipboard. Save keeps the settings in this page and says so. To make it real, store the rule and the code with the account, check a code is unique on the server, credit the referrer when the friend's second order ships, and keep the ladder in the same table.
How is it labelled, and what about right-to-left?
The rule is a group with every number field and the unit select named, the ladder is an ordered list, the copy button announces when the link is copied, and the status line is a polite live region present from the start. The code and the link read left to right inside a right-to-left page, and the amounts and counts sit in isolated runs so the sentence keeps its order.
Related
- Pro
Referral Code Onboarding
Profile and accountA setup panel that loads with a friend's code applied, shows what it takes off the first invoice, and lets a different code be tried, with copyable sample codes.
- Pro
Referral Invite Sheet
Side sheetsA meal-kit box page with its referral sheet shown open from the end edge: a code and a link that really copy, a friend's email and the message that would go with it, a reward ladder marked Reached or how many friends to go, and three figures.
- Pro
Access Token Hygiene Settings
Sign-in and securityAn access token settings panel that flags risky tokens (no end date, unused for 90 days, the admin scope, ending soon), gives a token an end date from a menu, and revokes the ticked ones after an alert dialog lists them.
- Pro
Account Deletion Settings
Backups and exportsA whole-page account deletion that first asks what happens to each kind of data (delete, anonymise or transfer, with invoices locked for tax law), sums the choices in one sentence, then schedules deletion 14 days out behind a typed-email alert dialog.
- Pro
Alert Rules Settings
Alerts and auditAn alert rules panel where each rule is a sentence you edit in place with menus and a number field, beside a framed chart of its metric with the threshold line and a computed count of how often it would have fired.
- Pro
API Key Builder Settings
API and webhooksAn API key settings panel with a table of keys, a builder that sets None, Read or Write for each resource, and a try-a-request check that answers Allowed or Denied with the reason before anything is saved.