Skip to content

Soft card

Contact card with a pill-field form.

Usage

Usage
import { ContactSoftCard } from '@/components/blocks/contact-02'


<ContactSoftCard />


// Your own details, an extra phone field and a real submit handler
<ContactSoftCard
  title="Talk to our team"
  details={[
    { label: 'Email', value: 'team@quillmark.example', href: 'mailto:team@quillmark.example' },
    { label: 'Office', value: '500 Market Street\nSan Diego, CA 92101' },
  ]}
  socials={[{ network: 'x', href: '#' }]}
  fields={[
    { name: 'name', label: 'Name', required: true, autoComplete: 'name', width: 'half' },
    { name: 'phone', label: 'Phone', kind: 'tel', autoComplete: 'tel', width: 'half' },
    { name: 'email', label: 'Email', kind: 'email', required: true, autoComplete: 'email' },
    { name: 'message', label: 'Message', kind: 'textarea', required: true, maxLength: 800 },
  ]}
  onSubmit={async (values) => {
    const response = await fetch('/api/contact', { method: 'POST', body: JSON.stringify(values) })
    if (!response.ok) throw new Error('Failed to send')
  }}
/>

Install

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

Source

Props

Soft card props
PropTypeDefaultDescription
titlestring= 'We’d love to hear from you'Card heading.
descriptionReactNode= A short reply-time noteSupporting text under the heading. Pass an empty string to hide it.
detailsContactCardDetail[]= Email, phone and office addressStacked label and value pairs. Add an href to link a value, and use \n to break it onto several lines.
socialsLabelstring= 'Find us elsewhere'Small label above the social icons.
socialsContactCardSocial[]= Instagram, X, Facebook and YouTubeSocial icon links. network is one of 'instagram', 'x', 'facebook', 'youtube', 'linkedin' or 'tiktok'. Pass an empty array to hide the row.
fieldsContactCardField[]= Name, email, topic and messageForm fields in order. kind is 'text', 'email', 'tel', 'textarea' or 'choice' (a row of pills from options). Set required, autoComplete, minLength, maxLength (shows a counter) and width 'half' to pair two fields.
submitLabelstring= 'Send to the team'Submit button label.
notestring= 'Answers go out Monday to Friday, 9am to 6pm ET.'Small line under the button. Pass an empty string to hide it.
successTitlestring= 'Message received'Heading of the success panel, which receives focus after sending.
successMessagestring= 'It is in our queue now. Expect a reply…'Text in the success panel.
errorMessagestring= 'Something went wrong and your message was not sent. Please try again.'Shown under the button when onSubmit throws or rejects.
onSubmit(values: Record<string, string>) => void | Promise<void>= Simulated success after 1.2sCalled with trimmed values once every field is valid. Throw or reject to show the error state.
classNamestring= —Additional classes for the section.
styleCSSProperties= —Inline styles, handy for overriding the --pp-* theme variables.