shadcn.io is not affiliated with official shadcn/ui
Date Range Calendar Rental Contact Block for React
An equipment-hire request in four ruled bands: a tool select with its rates, an inline range calendar with a delivery switch, a band of hairline cells that prices the hire, then name and email.
Installation
Overview
An equipment-hire section for React with Base UI, laid out as four bands under a compact header, each ruled from the page's top rule with + marks. The first band is the tool: a select of six tools with its day rate, week rate and deposit beside it. The second is the dates: an inline calendar where the visitor chooses the first day and then the last (one day twice for a single day), with the first day, last day and length written out next to it, a switch for delivery and collection, and a ZIP code field that opens once delivery is on. Days before today are closed once the page is in the browser. The third is a band of four hairline cells (days, hire, delivery, total) that works out the price as the choices change, and the fourth holds the name, the email and the one primary button. Submitting checks every field, shows each problem under its field, marks the control invalid and moves focus to the first one; a valid request turns into a confirmation in the same space that repeats the tool, the dates, the delivery choice and the example total. It's built from Calendar, Select, Switch, Field, Input, Guides, Shine Button and Button, with CSS transitions for the entrances and your theme's tokens for every colour. For tool and equipment hire, party and event kit, vehicle and bike rental, and any page where a visitor books a thing for a span of days.
FAQ
How is the price worked out?
hireCost charges whole weeks at the week rate (four days' rate, set by WEEK_DAYS) and the days left over at the day rate, never more than a week. Nine days of a 42-dollar tool is one week (168 dollars) plus two days (84), so 252 dollars; delivery adds a flat 40. The figures are examples and the block says so under the band; the deposit is shown beside the rates, held at collection and not part of the total. Change the TOOLS rows, WEEK_DAYS and DELIVERY to match your own price list, or replace hireCost with a call to your quoting service.
How does the calendar know which days have passed?
Today is read after the block mounts, so the server's render stays the same and no month or year is written into the file. Before that moment no day is closed; afterwards every day before today is unavailable and struck through. The calendar opens on the current month, as the catalog's calendar does, and always draws six weeks so moving between months never changes the block's height.
How does a visitor pick a range, and what about a single day?
Choose the first day, then the last; the first day, last day and length are written beside the calendar, and the hire is priced once both are set. For a one-day hire, choose the same day twice. Choosing again after a full range starts a new one. On React Aria the first day is shown only once the second is chosen, because that library reports a range when it is complete; the other bases show the first day at once.
How does the calendar differ between libraries?
The calendar is the catalog's day picker in range mode, controlled from the block's two days, and closes days with a disabled function.
On every base the chosen days are filled with the foreground colour, never the primary colour, so the button stays the only primary control.
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 a call to your hire desk: details, from, to and delivery hold everything the visitor chose. hire@toolhaus.example is on the reserved .example domain and the phone number is in the reserved fictional range.
How does it fit on a phone?
The bands stack in order: the tool and its rates, the calendar (it stays full width and legible at 320 pixels), then the chosen days and delivery, the price cells two by two, and the details with a full-width button. The form starts under the header, and the price band always sits directly under the calendar.
Related
- Pro
Month Calendar Scheduler Contact
Calls and meetingsA scheduling split: a host panel at the start; a month calendar that closes weekends and past days, the open times of the chosen day and a name and email at the end, with Confirm unavailable until a day and time are chosen.
- Pro
Budget Range Slider Contact
Quotes and estimatesA 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.
- 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
Table Reservation Contact
Events and datesA restaurant reservation in a card in card: a party size stepper, a date picker that closes Mondays and past days, five sittings as choices and a form that checks itself and confirms in place.
- Pro
Order Lookup Contact
Support and feedbackAn order desk that looks the order up first: a number and email, a read-only timeline with dates counted from today, then a help form that wakes once an order is found.
- Pro
Booked Dates Wedding Contact
Events and datesA date enquiry for a wedding planner that shows the calendar first: a season band, an inline calendar with booked and too-soon days crossed out, guests, a venue style and contact details.