shadcn.io is not affiliated with official shadcn/ui
Budget Range Slider Contact Block for React
A roofing quote request as a card in a card: three kinds of job, a two-thumb budget slider that says in words what the range covers, and a short form that checks itself.
Installation
Overview
A quote request section for React with Base UI, built as a card in a card under a start-aligned header: a muted frame with + marks on its corners holds a raised panel and a strip of contact details. In the panel, one under the other: the kind of job (repair, replace or new build, as three tiles with an example line under them), a budget as a two-thumb slider from $5,000 to $80,000 with a dot and a name at five amounts, and a sentence that says in words what the range covers: the square feet of roof it usually buys at an example rate for that kind of job. Then a name, an email and when the work should start, in a Select. Submitting checks every field, shows each problem under its field and moves focus to the first one; a valid request turns into a confirmation in the same space, which takes focus. It's built from Slider, Segment Group, Select, Field, Input, Frame, Guides and Shine Button, with your theme's tokens for every colour. For trades, builders and agencies that quote by project.
FAQ
How does the two-thumb slider work?
Each thumb is its own stop for the keyboard: Tab to the first one and the arrow keys move it in steps of $1,000; Tab again for the second. The thumbs never cross, and they stay at least two steps ($2,000) apart. The thumbs are named "Lowest budget" and "Highest budget". The range in large type is the visible value. The dots and their amounts under the track are decoration, hidden from assistive technology. When you stop moving a thumb, or change the job, one hidden status line reads the new sentence.
Where does the sentence under the slider come from?
From SCOPES at the top of the file: each kind of job has an example rate in dollars for each square foot of roof ($40 for a repair, $9 for a replacement, $14 for a new build). The sentence divides the two ends of the range by that rate and rounds to the nearest hundred square feet. The rates are made up, the sentence ends with "Example only." and none of it is a quote.
How does the form check what's typed?
The form has noValidate, so the browser's own bubbles stay away and the block shows its own messages. On submit, problems checks a name, an email address with an @ and a domain, and a start time. Each problem appears under its field with an icon, the control is marked invalid and described by the message, and focus moves to the first one. Leaving a filled field checks it, and editing a field that shows an error re-checks it as you type.
Where does the form send its data?
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 kind of job, the two ends of the budget, the name, the email and the start time. The confirmation repeats the job, the range and the start time and says a roofer will write to the address given; it promises nothing else.
Are the email address and phone number real?
No. quotes@rooflark.example uses the .example domain, which is reserved for examples, and +1 (415) 555-0174 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 with yours. The phone number keeps its order in a right-to-left layout.
How does it fit on a phone?
The three job tiles stack, the slider takes the whole width of the panel with its five dots under it, and name, email and start time go one per row. The sentence under the slider and the example line keep their height as the job changes, so nothing below them moves. The button goes full width.
Related
- 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
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
Guest Count Ruler Contact
Events and datesAn event-catering request for a caterer: a guest-count slider drawn as a ruler beside the cost per head and the total, then a three-course menu, dietary needs and a short form on ruled bands.
- Pro
Card in Card Contact
Contact formsA card-in-card contact section for a bookkeeping service: the details of the desk you pick beside a raised form with a live message counter.
- Pro
Custom Quote Pricing
Sales and partnersA quote request for a security platform: the pitch and three ruled points beside a short form whose submit button sits inside the first screen, and a confirmation that takes focus once it's sent.
- Pro
Negotiable Pricing
CalculatorsPricing that starts from a range: seats and contract length produce a per-seat estimate drawn as a band on a scale with the list price marked, and a field for your own target price that sends it to sales.