Skip to content

Illustrated contact

Contact form flanked by line-art figures.

Usage

Usage
import { ContactIllustrated } from '@/components/blocks/contact-06'


<ContactIllustrated />


// Send the form to your own endpoint
<ContactIllustrated
  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.')
  }}
/>


// Just the form, without figures or the map
<ContactIllustrated
  title="Talk to sales"
  showIllustrations={false}
  showLocation={false}
  consentLabel={
    <>
      I agree to the <a href="/privacy">Privacy Policy</a>.
    </>
  }
/>

Install

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

Source

Props

Illustrated contact props
PropTypeDefaultDescription
titlestring= 'Let’s talk about your crews'Main heading.
descriptionstring= 'Comparing plans, retiring the whiteboard schedule…'Intro text under the heading.
fieldsContactFormField[]= Name, email, phone, business name, topic, crew size and messageForm fields, each with a name, label, type ('text', 'email', 'tel', 'select' or 'textarea'), placeholder, autoComplete, required, minLength, select options and half (half width from the small breakpoint). A 'tel' field gets a country-code select and submits the dial code with the number plus a `<name>Country` value.
submitLabelstring= 'Get in touch'Submit button text.
consentLabelReactNode= Privacy Policy agreementLabel of the required consent checkbox. Links inside are styled for you.
successTitlestring= 'Thanks, we will be in touch'Heading of the success panel, which receives focus after sending.
successDescriptionstring= 'A member of our team will answer…'Text under the success heading.
showIllustrationsboolean= trueShow the line-art figures beside the form on large screens.
showLocationboolean= trueShow the map and contact details row below the form.
locationEyebrowstring= 'Visit us'Small label above the location heading.
locationTitlestring= 'Drop by the Madison office'Heading of the location row.
mapLabelstring= 'Map of the streets around the Turnstead office…'Text alternative for the decorative map, read by screen readers.
contactDetailsContactDetail[]= Address, email, phone and hoursRows in the details card, each with a label, value and optional href. The 'Address' row also appears on the map.
socialsContactSocialLink[]= Instagram, Facebook, X and YouTubeSocial icon links, each with a label (the accessible name), an href and an icon: 'instagram', 'facebook', 'x' or 'youtube'.
onSubmit(values: Record<string, string>) => void | Promise<void>= Simulated success after 1.2sCalled with the form values once everything is valid. Throw to show your error message.
styleCSSProperties= —Inline styles, handy for overriding the `--pp-*` theme variables.
classNamestring= —Extra classes for the outer section.