shadcn.io is not affiliated with official shadcn/ui
Photo Access Repair Contact Block for React
A repair request for a housing association: three photo slots with thumbnails, two access switches, a visit window, and a what-happens-next panel that rewrites itself as you choose.
Installation
Overview
A contact section for React with Base UI that collects a repair with photos and access details. A start-aligned header sits over two framed cells whose lines overshoot their corners. The first holds the form: a name, a flat, what is broken, a File Upload that takes up to three images as thumbnails (three slots, the empty ones outlined, each photo with its name and a remove button), two Switches for access ("OK to enter if I'm out", "Pets at home") and a Toggle Group for the visit window (morning, afternoon, any time). The second is a "what happens next" list whose steps rewrite as you choose: the photos are counted, the window is named, and the access lines follow the switches, each line keeping its space so nothing moves. The form checks itself on submit, shows each problem under its field, focuses the first one, and turns into a confirmation in the same space that names the photos. On a phone the list comes after the form. It's built from File Upload, Switch, Toggle Group, Field, Input, Textarea, Guides and Shine Button, with your theme's tokens for every colour. For housing associations, landlords and property managers who need to see the fault and know how to get in.
FAQ
Are the photos really uploaded?
No. They stay in the visitor's browser tab and the thumbnails are previews of the visitor's own files; nothing is sent. The block ships no photographs. To make it real, send files where submit waits, and check the type and size again on your server, because the drop zone's limits are only a courtesy.
What happens with a wrong file or a fourth photo?
It is not added, and a polite line under the slots says which file and why ("notes.pdf is not an image", "photo.png is over 8 MB", "would be a fourth photo"). A drop that mixes good and refused files keeps the good ones: the block listens to the drop zone's accept and reject events, not its change event, which would report an empty list after a mixed drop. Change MAX_PHOTOS, MAX_MB and ACCEPT at the top of the file.
What does the panel on the side do?
It is a plain ordered list of four steps. Three lines change with the form: how many photos you added, the window you picked, and whether the engineer may enter when you are out and knows about pets. All the wordings share one grid cell, so a change never moves the page. The hours in it are example wording: write your own association's.
Can it be used without a mouse?
Yes. The drop zone opens the file chooser with Enter or Space, each remove button is a tab stop named after its file, and removing a photo returns focus to the drop zone. The switches and the three-way window toggle use arrow keys and Space as their libraries do, and the status line reads what was added, removed or refused.
Where does the request go?
Nowhere yet. The submit waits 800 milliseconds, as a stand-in for a request, then shows the confirmation, which echoes the flat, the window, the access choices and the photo names. Replace the timer in submit with your call: details, files, enter, pets and visit hold everything.
Related
- Pro
Repair Triage Contact
Repairs and claimsA repair report for a lettings agent: six category cells on shared hairlines, each with its published reply time, a callout with safety advice that follows the choice, and a form with a searchable list of homes.
- Pro
File Attachments Contact
Support and feedbackA support request on a card in card with a file drop zone: up to four PDFs or images, a progress bar per file, an error row for a wrong type, and a form that waits for the files before it sends.
- Pro
Tappable device repair Contact
Repairs and claimsA repair request for a phone shop where four buttons on a drawn phone pick the parts, and a model menu lists an example price for each.
- Pro
Warranty Meter Contact
Repairs and claimsA warranty claim where the purchase date works out your cover on one line: a meter of the 24 months used, the month cover ends, and issue types that change with it.
- Pro
Support Channels Contact
Support and feedbackA support desk for a help desk tool: a band of four channels with their response times above a form with a subject, a normal or urgent priority and a message, which checks itself and confirms in place.
- Pro
Outage priority triage Contact
Support and feedbackAn urgent hosting request with three priorities, one promised response at a time, and a phone line that appears only for an outage.