Skip to content

Contact card

Contact card with a form beside contact details.

Usage

Usage
import { ContactDesk } from '@/components/blocks/contact-04'


<ContactDesk />


// Send the form to your own endpoint
<ContactDesk
  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, details and fields
<ContactDesk
  title="Get in touch"
  details={[
    { label: 'Email', value: 'hello@acme.example', href: 'mailto:hello@acme.example' },
    { label: 'Office', value: '12 Harbour Road, Bristol BS1 5TT' },
  ]}
  socials={[{ label: 'Acme on X', href: '#', icon: 'x' }]}
  fields={[
    { name: 'name', label: 'Full name', autoComplete: 'name', required: true, width: 'half' },
    { name: 'phone', label: 'Phone', kind: 'tel', autoComplete: 'tel', width: 'half' },
    { name: 'message', label: 'Message', kind: 'textarea', required: true, minLength: 10 },
  ]}
/>

Install

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

Source

Props

Contact card props
PropTypeDefaultDescription
titlestring= 'Get a reply from a real person'Card heading.
descriptionstring= 'Planning a rollout, moving from another tool or looking to team up?…'Intro under the heading. Pass an empty string to hide it.
detailsContactDeskDetail[]= Email, phone and officeRows in the side column, each with a label, a value and an optional href (mailto:, tel: or a map link).
socialsLabelstring= 'Elsewhere'Label above the social buttons, also used as the nav name.
socialsContactDeskSocial[]= X, Instagram, Pinterest and YouTubeRound social buttons, each with a label (the accessible name), an href and an icon: 'x', 'instagram', 'pinterest' or 'youtube'. Pass an empty array to hide them.
fieldsContactDeskField[]= Name, email, organisation, reason and detailsForm fields, each with a name, label, kind ('text', 'email', 'tel', 'select' or 'textarea'), placeholder, required, autoComplete, options, minLength, maxLength (adds a counter to textareas) and width ('full' or 'half').
submitLabelstring= 'Send enquiry'Submit button text.
responseNotestring= 'Most enquiries get an answer within hours.'Short note beside the submit button. Pass an empty string to hide it.
successTitlestring= 'Enquiry sent'Heading of the confirmation panel, which receives focus after sending.
successMessagestring= 'Thank you. A specialist will write back…'Text under the confirmation heading.
onSubmit(values: Record<string, string>) => void | Promise<void>= Simulated success after 1.1sReceives the trimmed values once every field is valid. Throw an Error to show its message in the error state.
classNamestring= —Extra classes for the section.
styleCSSProperties= —Inline styles, handy for overriding the --pp-* theme variables.