shadcn.io is not affiliated with official shadcn/ui
Placement Fee Estimate Contact Block for React
A staffing-agency form that estimates a placement fee from the hire type, the rate and the number of seats, and labels the figure as an example.
Installation
Overview
A placement-fee estimate for React with Base UI, for Staffwick, a staffing agency. A Segment Group picks Permanent, Contract or Temporary. Permanent asks for a yearly salary, contract asks for a day rate and a number of weeks, and temporary asks for a weekly rate and a number of weeks. The unused rate fields stay mounted in the same cell, hidden and inert, so the form does not jump. A seats Number Input applies to every hire type. The example fee is 18% of the salary, 12% of the day rate times 5 times the weeks, or 10% of the weekly rate times the weeks, then times the seats. It is shown in a Data List and as a large figure, and the sentence under it states that formula and says "Example only". A role-family Select is recorded and does not change the fee. On a wide screen the fee sits at the start and the form is first in the document. On a phone the fee sits under the hire-type toggle. Submitting checks the fields for the hire type that is showing, shows each problem under its control and moves focus to the first one. A valid search turns into a confirmation in the same cell, repeating the hire, the role, the fee, the seats and the email, and says nothing was invoiced. The page's rails and top rule come from Guides. It's built from Segment Group, Number Input, Data List, Select, Field, Input, Shine Button, Button and Guides, with CSS for the header entrance and your theme's tokens for every colour. For staffing agencies and any page where a quote should update before the form is sent.
FAQ
Where does the search 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 hire type, the rates, the weeks, the seats, the role family, the name and the email. Show the confirmation when the request succeeds, and an error line in the form when it doesn't. The fee is an example. Nothing is invoiced.
How is the fee worked out?
Permanent is 18% of the yearly salary, times the seats. Contract is 12% of the day rate times 5 days times the weeks, times the seats. Temporary is 10% of the weekly rate times the weeks, times the seats. The defaults are a $90,000 salary, a $640 day rate for 12 weeks, a $1,600 weekly rate for 8 weeks, and 1 seat, which come to $16,200, $4,608 and $1,280. The percents, the 5 days and those defaults live next to the arithmetic, and the sentence under the fee is built from the same numbers. The figure is a polite live region, so a change is announced. The role family is not part of the sum.
How is the fee announced?
The large figure is plain text, not a live region. A separate status line speaks "Example fee" and the amount once, about 700 milliseconds after the last change, and stays silent until the fee first differs from its starting value. The hire, basis and formula lines for all three hire types sit in one grid cell with the unused two invisible and inert, so the panel keeps its height when you switch.
What happens to the fields that are not in use?
They stay in the document, in the same grid cell, invisible and inert. Switching hire type shows the matching set and hides the others without unmounting them, so a salary you typed is still there if you switch back. Only the visible set is checked on submit. The Segment Group is the same control on every base, and clearing it is ignored so one hire type stays selected.
How do the number fields keep their ids?
Salary, day rate, weekly rate, weeks and seats are whole numbers. Grouping commas are stripped before the value is stored. Seats run from 1 to 40.
The id sits on NumberInputInput. onValueChange still receives { value } on every base.
How is the role family select labelled?
The label above it names the control, and focus can land on it when the family is missing. A line under it says the family does not change the example fee.
The trigger takes the id, and the label points to it with htmlFor.
Are the email address and phone number real?
No. hello@staffwick.example uses the .example domain, which is reserved for examples, and +1 (415) 555-0193 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 fee keep their order in a right-to-left layout.
Related
- Pro
Bulk Calculator Gifting Contact
Quotes and estimatesA bulk gifting enquiry with a recipients stepper and a row of gift prices, a bill worked out right under them in three cells (gifts, volume discount, total) and a ladder that shows the next discount step.
- Pro
Pitch Strength Startup Contact
ApplicationsA startup pitch form with a live check: a one-line pitch ticks three checks as you type, beside a stage choice, a paying-customers stepper and a panel of what the fund writes at each stage.
- Pro
Premium Builder Contact
Finance and propertyA home-cover quote for an insurer, split by a hairline: a slider over five levels of cover and three risk switches at the start, a premium built line by line and a short form at the end.
- Pro
Crew Estimate Moving Contact
Quotes and estimatesA moving quote in three bands: a home-size segment and special-item toggles, a live crew, truck and hours estimate, then distance, move date, name and email.
- 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
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.