Skip to content

Split contact

Dark split contact section with a form card.

Usage

Usage
import { ContactSplit } from '@/components/blocks/contact-01'


<ContactSplit />


// Send the form to your own endpoint
<ContactSplit
  email="studio@halcyon.example"
  onSubmit={async (values) => {
    const response = await fetch('/api/contact', {
      method: 'POST',
      body: JSON.stringify(values),
    })
    if (!response.ok) throw new Error('We could not send your message. Please try again.')
  }}
/>


// Your own copy, socials and fields
<ContactSplit
  headline={['Need a hand?', 'Talk to us.']}
  availability="Online now"
  socials={[
    { label: 'Halcyon on X', href: '#', icon: 'x' },
    { label: 'Halcyon on YouTube', href: '#', icon: 'youtube' },
  ]}
  fields={[
    { name: 'name', label: 'Your name', autoComplete: 'name', required: true },
    { name: 'email', label: 'Work email', type: 'email', autoComplete: 'email', required: true },
    { name: 'budget', label: 'Budget', type: 'select', options: ['Under $10k', '$10k to $50k', 'Over $50k'] },
    { name: 'message', label: 'How can we help?', type: 'textarea', required: true, minLength: 10 },
  ]}
/>

Install

pnpm dlx shadcn@latest add @pastaui-pro/contact-01

Source

Props

Split contact props
PropTypeDefaultDescription
headlinestring[]= ['Have something in mind?', 'Tell us.']Headline lines, each on its own line.
emailstring= 'studio@corvane.example'Email address shown as a mailto link. Pass an empty string to hide it.
emailLabelstring= 'Prefer email? Write to us at'Text before the email link.
socialsContactSocial[]= Instagram, LinkedIn and XRound social buttons, each with a label (used as the accessible name), an href and an icon: 'instagram', 'linkedin', 'x', 'youtube' or your own node.
availabilitystring= 'Booking projects for spring'Text beside the live dot. Pass an empty string to hide the badge.
formTitlestring= 'Tell us about the project and we'll come back with a plan'Heading inside the form card.
fieldsContactField[]= Name, email, project type and detailsForm fields, each with a name, label, type ('text', 'email', 'textarea' or 'select'), autoComplete, required, minLength and select options.
submitLabelstring= 'Start the conversation'Submit button text.
successTitlestring= 'Got it, thank you'Heading of the success panel, which receives focus after sending.
successDescriptionstring= 'Someone from the studio will read your note…'Text under the success heading.
onSubmit(values: Record<string, string>) => void | Promise<void>= Simulated success after 1.2sCalled with the field values once the form is valid. Throw an Error to show its message in the card.
classNamestring= —Additional classes for the section.
styleCSSProperties= —Inline styles, handy for overriding the --pp-* color variables.