Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Overlapping Panel Hero Contact Block for React

A hero-sized contact section for an architecture practice: a tinted band with a large headline and three ways to reach the studio, and a raised form panel that overlaps the band's lower edge.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A hero-sized contact section for React with Base UI. A band tinted across the whole page carries a large headline, one sentence and three ways to reach the practice side by side (write, call and visit) in an address. The form hangs from the band: a raised panel on the card colour, with a ring, overlaps the band's lower edge and carries on below it. Name, email, where the site is, an optional phone number and what you would like to build; submitting checks the required fields, shows each problem under its field and moves focus to the first one, and a valid enquiry turns into a confirmation in the same space. The page's rails and top rule come from the Guides spine. It's built from Field, Input, Textarea, Guides, Shine Button and Button.

FAQ

How does the panel overlap the band?

The band is a tinted layer behind the first part of the section, stretched to the viewport's width, and the panel has a negative top margin of 5rem (6rem from md), so its first part sits on the band and the rest on the page. The band's bottom padding is larger than the overlap, so the details above never touch the panel. Change the two values together if you want a deeper or shallower overlap.

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 name, email, site, phone and message. The phone number is optional and unchecked.

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, where the site is and what the visitor has in mind. 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.

Are the email address, phone number and address real?

No. studio@oldgrange.example uses the .example domain, which is reserved for examples, and +1 (415) 555-0178 is in the 555-0100 to 555-0199 range set aside for fiction; the town and street are made up. Replace EMAIL, PHONE, HOURS and the address in the file. The phone number keeps its order in a right-to-left layout.

Does the band follow my theme?

Yes. The band is a muted tint and the panel is the card colour with a ring and a shadow, so both follow whichever preset you install, light or dark. Nothing in the block uses the primary colour except the submit button.

How does it fit on a phone?

The three ways to reach the studio stack in the band, one per row, and the panel still overlaps the band's lower edge, with its fields one per row. The submit button goes full width. Nothing scrolls sideways at 320 pixels. The band's content and the panel fade up once on load; with reduced motion they simply appear.

  • Pro

    A 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

    A 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

    A contact section for a coffee roaster with four cafes: city tabs over a panel with address, hours and a street map, and a form addressed to the cafe you picked.

  • Pro

    A reverse split contact hero on solid rails: an abstract dot map with a pulsing marker per office fills the first half up to a divider, beside a headline, a Shine Button and three offices as ruled rows.

  • Pro

    A 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

    A 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.