ContactSection
Share contact details, department contacts, opening hours, a form slot, map slot, CTA, and success-state content.
ContactSection lays out business contact information and optional consumer-provided content slots. It does not submit forms, send email, validate requests, or connect to a map provider.
Beta API maturity: Beta.
Installation
import {
ContactSection,
type ContactSectionProps,
type ContactSectionVariant,
} from "@puzzle-ui/pieces";Variant previews
Every one of the thirteen layouts has an individual preview. The examples include business details, department contacts, a form slot, map slot, and success-state slot.
split - Pair contact information with a form slot.
centered - Keep a simple contact invitation focused.
form - Give the consumer-provided form slot priority.
card - Set contact information on a distinct surface.
map - Pair office details with a map slot.
details - Make practical contact details easy to find.
minimal - Keep the contact block compact.
full-width - Give map or form content more space.
departments - Show contact people by department.
multi-column - Distribute contact details across columns.
editorial - Use a calmer, text-led presentation.
support - Guide customers to the right support channel.
inquiry - Frame a consumer-provided inquiry form slot.
API
| Prop | Type | Description |
|---|---|---|
variant | ContactSectionVariant | split (default), centered, form, card, map, details, minimal, full-width, departments, multi-column, editorial, support, or inquiry. |
address | ReactNode | Optional postal address. |
phone, email | string | Optional values rendered with tel: and mailto: links. |
openingHours | ReactNode | Optional hours or availability content. |
details | readonly BusinessContactItem[] | Additional labeled contact data. |
departments | readonly BusinessContactDepartment[] | Optional named groups and department contacts. |
formSlot | ReactNode | Consumer-owned form markup; this component adds no submission behavior. |
mapSlot | ReactNode | Consumer-owned map or location content; mapLabel names its region. |
successSlot | ReactNode | Optional consumer-owned success content announced politely. |
| Shared section props | MarketingSectionBaseProps | Heading, CTA actions, root element, native section attributes, and children. |
Required and default values
Requiredness follows the exported TypeScript type. A dash means no component-level default is applied; variant-specific requirements are described in the API table above.
| Prop | Required | Default |
|---|---|---|
variant | No | "split" |
address | No | — |
phone | No | — |
email | No | — |
openingHours | No | — |
details | No | empty array |
departments | No | empty array |
formSlot | No | — |
mapSlot | No | — |
mapLabel | No | "Map" |
successSlot | No | — |
Usage
<ContactSection
variant="split"
title="Start a conversation"
address="12 Market Street, Amsterdam"
phone="+31 20 123 4567"
email="hello@example.com"
formSlot={<ContactRequestForm />}
mapSlot={<OfficeMap />}
/>ContactRequestForm and OfficeMap above are application-owned components passed through the slots. Provide accessible names and labels in the supplied markup. Missing contact details are omitted, and the section never fabricates a contact endpoint or success response. Server rendering is supported.
Accessibility and responsive behavior
Contact values are rendered as native tel: and mailto: links. Department
groups have headings, the optional map region uses mapLabel, and a supplied
success slot is announced politely. Labels, validation, and focus management
for formSlot remain the application's responsibility.
The split and multi-column variants stack on narrow viewports. Keep supplied maps and forms fluid, and test the section at mobile and desktop widths.
Theme support and composition
The section inherits semantic colors, spacing, and typography from
@puzzle-ui/theme. Compose it with UI FormField, TextInput, and Button
inside formSlot, and use the children slot for explanatory content.
Related components
- Location Section for selectable venues and opening hours.
- About Section for organization context.
- Framework integration for Next.js and TanStack Start.
Customization
Use the component's className and documented slots to adapt the composition. Prefer a caller-provided ReactNode for media, actions, or controls rather than adding domain behavior to the section.
import type { ComponentProps } from "react";
import { ContactSection } from "@puzzle-ui/pieces";
type ContactSectionProps = ComponentProps<typeof ContactSection>;
export function CustomizedSection(props: ContactSectionProps) {
return <ContactSection {...props} className={[props.className, "brand-section"].filter(Boolean).join(" ")} />;
}TypeScript example
The package exports this component from its root. Derive a wrapper's exact prop type from the public component rather than widening it:
import type { ComponentProps } from "react";
import { ContactSection } from "@puzzle-ui/pieces";
type ContactSectionProps = ComponentProps<typeof ContactSection>;
export function SectionWrapper(props: ContactSectionProps) {
return <ContactSection {...props} />;
}