shadcn.io is not affiliated with official shadcn/ui
Live Thread Drawing Contact Block for React
A contact split for a photo lab: a short form beside a framed drawing of the email thread, whose first bubble fills with your name and words as you type.
Installation
Overview
A contact split for React with Base UI, divided by a hairline that meets the page's top rule with a + mark. At the start, a compact header and a short form: name, email and a question. At the end, a framed drawing of the email thread the team will see: a greyscale window with a first bubble that fills with the visitor's name and message as they type, marked "Draft" until it is sent and "Delivered" after, and a reply bubble from the lab that greets them by first name and promises a reply within a day. There is no photograph: the drawing is built from avatars, bubbles and the frame. Submitting checks the fields, shows each problem under its field and moves focus to the first one; a valid message turns into a confirmation in the same space. It's built from Field, Input, Textarea, Avatar, Guides, Shine Button and Button.
FAQ
How does the drawing follow the form?
The drawing reads the same details state as the form: the first bubble shows the name and message as typed (up to three lines, with the rest cut off), the avatar shows the name's initials, and the reply bubble uses the first name. Empty, it shows placeholder lines. The drawing is decorative and hidden from assistive technology, so a screen reader doesn't hear it change on every key; the form is what a visitor reads.
Why a drawing and not a photo?
The drawing needs no image file, so there is nothing to host, size or credit, and it follows your theme in light and dark. It is also specific to the form: a photograph beside a form tells you nothing, but a thread that fills in as you type shows exactly what the other side will see.
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 and marks the bubble "Delivered". Replace that timer in submit with your own call: details holds the name, email and message.
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 question. Each problem appears under its field with an icon, the control gets aria-invalid and an aria-describedby that points to the message, and focus moves to the first one. Typing in a field clears its message.
Related
- Pro
Details Panel Split Contact
Contact formsA contact split for a design studio: a tall tinted panel of email, phone and address with a copy button each, hours and profile links, beside a raised brief form.
- 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
Street Map Contact
Contact formsA contact section for a print shop: a form with a team select beside a framed street-map drawing with a dashed walking route from the station, and the address and hours under it.
- Pro
Minimal Contact Form
Contact formsThe calmest contact form, for a mail client: a centred heading and three fields on the page column with inline validation, a message counter and a one-line thank-you.
- Pro
Talk to Sales Contact
Contact formsA talk-to-sales split for a scheduling platform: what happens next as three numbered steps and a band of contact details beside a form that checks itself, shows each problem under its field and confirms in place.
- Pro
Answers First Contact
Contact formsA contact form that tries to answer first: five numbered answers in an accordion beside a form whose subject field opens the answers that match, then checks itself and confirms in place.