Skip to Content

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.

390 × 844

centered - Keep a simple contact invitation focused.

390 × 844

form - Give the consumer-provided form slot priority.

390 × 844

card - Set contact information on a distinct surface.

390 × 844

map - Pair office details with a map slot.

390 × 844

details - Make practical contact details easy to find.

390 × 844

minimal - Keep the contact block compact.

390 × 844

full-width - Give map or form content more space.

390 × 844

departments - Show contact people by department.

390 × 844

multi-column - Distribute contact details across columns.

390 × 844

editorial - Use a calmer, text-led presentation.

390 × 844

support - Guide customers to the right support channel.

390 × 844

inquiry - Frame a consumer-provided inquiry form slot.

390 × 844

API

PropTypeDescription
variantContactSectionVariantsplit (default), centered, form, card, map, details, minimal, full-width, departments, multi-column, editorial, support, or inquiry.
addressReactNodeOptional postal address.
phone, emailstringOptional values rendered with tel: and mailto: links.
openingHoursReactNodeOptional hours or availability content.
detailsreadonly BusinessContactItem[]Additional labeled contact data.
departmentsreadonly BusinessContactDepartment[]Optional named groups and department contacts.
formSlotReactNodeConsumer-owned form markup; this component adds no submission behavior.
mapSlotReactNodeConsumer-owned map or location content; mapLabel names its region.
successSlotReactNodeOptional consumer-owned success content announced politely.
Shared section propsMarketingSectionBasePropsHeading, 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.

PropRequiredDefault
variantNo"split"
addressNo—
phoneNo—
emailNo—
openingHoursNo—
detailsNoempty array
departmentsNoempty array
formSlotNo—
mapSlotNo—
mapLabelNo"Map"
successSlotNo—

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.

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} />;
}