shadcn.io is not affiliated with official shadcn/ui
Tier and Password Join Contact Block for React
A swim-club join form with a tier toggle that rewrites the perks, a password strength bar with two rules, and a required terms box.
Installation
Overview
A join form for React with Base UI, for Quietbay Swim Club. A Segment Group offers Lane, Family and Club. The perks beside it, in a Data List, read that tier's dues, who swims, how many guest passes and which locker. The form asks for a name, an email and a password. A Progress bar and a two-line rule list follow the password: 8 characters, and a number. A terms Checkbox is required. The dues are an example, and the confirmation says nothing was charged. Submitting checks every field, shows each problem under its control and moves focus to the first one. A valid join turns into a confirmation in the same cell, repeating the first name, the tier, the dues and the email. The page's rails and top rule come from Guides, and a split divider separates the perks from the form. It's built from Segment Group, Password Input, Progress, Checkbox, Data List, Field, Input, Shine Button, Button and Guides, with CSS for the header entrance and your theme's tokens for every colour. For clubs, memberships and any page where one choice should rewrite the terms beside it.
FAQ
Where does the join go?
Nowhere yet. The submit handler waits 800 milliseconds, as a stand-in for a request, then shows the confirmation. Replace that timer in submit with your own call: details holds the tier, name, email, password and whether the terms were agreed. Show the confirmation when the request succeeds, and an error line in the form when it doesn't. This example does not charge the dues.
What changes when the tier changes?
Lane, Family and Club each carry a monthly dues figure, who swims, a guest-pass count and a locker line. One Data List per tier sits in one grid cell, the two unchosen ones invisible and inert, so the perks keep the same height whichever tier is chosen and nothing below them moves. Each is built from the tier's own data, so the pass count and the dues are not typed twice. The Segment Group is the same control on every base. The join button names the chosen tier.
How is the password strength decided?
Two rules: at least 8 characters, and at least one digit. The bar is half full when one rule is met and full when both are. The words beside it say "Both rules met", "One rule met" or "Neither rule met", and each rule says "Met" or "Still needed". A password that misses a rule is rejected on submit. The show-and-hide control is the Password Input's own trigger.
Those Password Input roots do not take onValueChange. The value and onChange sit on PasswordInputInput, which also takes the id.
Does the strength bar announce itself?
The bar is labelled "Password strength". It is decorative in the sense that the rule list next to it is the text a person reads. The bar's value is the number of met rules times 50, out of 100.
Progress takes value and max and draws its own track. The indicator is forced to the foreground colour so the page's primary stays on the join button.
How is the terms box named?
The sentence beside the box names it, because the checkbox control does not take a wrapping label on every base. It is required. The error says to agree to the membership terms.
onCheckedChange receives a boolean.
Are the email address and phone number real?
No. hello@quietbay.example uses the .example domain, which is reserved for examples, and +1 (415) 555-0190 is in the 555-0100 to 555-0199 range set aside for fiction. Replace EMAIL, PHONE, PHONE_HREF and HOURS at the top of the file. The phone number and the dues keep their order in a right-to-left layout.
Related
- Pro
Payment Schedule Course Contact
ApplicationsA course enrolment on shared hairlines: three programmes as choice cards, a plan switch that rewrites a payment schedule table to the cent, and a form that checks itself and confirms in place.
- Pro
Campaign Planner Fundraiser Contact
Join and giveA fundraising planner as a split: a goal, a length and four channels on one side, a live projection with a bar on the other, and a form that sends the plan to a coach.
- Pro
Eligibility Checklist Scholarship Contact
ApplicationsA scholarship application on a card in card: four eligibility criteria as ruled checkbox rows with a verdict line, an essay with a word count that fills a bar toward its minimum, and a form that checks itself and confirms in place.
- Pro
Amount Presets Donation Contact
Join and giveA donation card in card: amount presets in a 2x2 grid beside a custom amount, a monthly switch, an impact line that rolls with the amount, a card-fee box and a total the button repeats.
- Pro
Loan Payment Slider Contact
Finance and propertyA personal-loan request for a lender: an amount slider with a tick at each $5,000 and a term to pick, a panel that works the monthly payment out as you move, and a form that checks itself.
- Pro
Document Checklist Contact
Finance and propertyA tax-return checklist as a card in a card: three ways of filing, eight documents with a tag that says which are needed, a bar of the needed ones ready and a switch to send the rest later.