> ## Documentation Index
> Fetch the complete documentation index at: https://docs.digifist.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact form

> Display a simple contact form with name, email, and message fields for customer inquiries and support requests.

The Contact form section provides a straightforward way for customers to reach you with inquiries, support requests, or feedback. It includes three pre-configured fields (Name, Email, Message) and integrates with Shopify's contact form system for email delivery.

This section is essential for customer communication and typically used on dedicated contact pages or support pages.

<img src="https://mintcdn.com/digifist/f_DhbveqWg3dNhZm/images/theme/sahara/sections/form-contact/form-contact-overview.png?fit=max&auto=format&n=f_DhbveqWg3dNhZm&q=85&s=3d444ea5f04897464d8c70745f7afd7e" alt="Contact form section overview" width="3280" height="2186" data-path="images/theme/sahara/sections/form-contact/form-contact-overview.png" />

## What this section controls

This section controls contact form displays with the following capabilities:

* Pre-configured contact form with three standard fields
* Name field (optional, auto-fills for logged-in customers)
* Email field (required, auto-fills for logged-in customers)
* Message/body field (textarea for longer messages)
* Form submission handling with success/error messaging
* Customer data auto-population for logged-in users
* Narrow, focused layout optimized for form completion

## How the Contact form works

The Contact form section uses Shopify's built-in contact form functionality:

**Form fields:**

* **Name** - Text input, optional, auto-completes with customer name if logged in
* **Email** - Required text input with email validation, auto-completes if customer logged in
* **Message** - Large textarea for customer message or inquiry

**Form submission:**

1. Customer fills out form
2. Form validates required fields (email)
3. Upon successful submission:
   * Displays success message
   * Sends email to store owner's notification address
   * Form content sent to Shopify admin customer contact records
4. If errors occur:
   * Displays error messages
   * Preserves form data for correction

## Getting started

<Steps>
  <Step title="Open Theme Customizer">
    From Shopify admin, access the Theme Customizer.
  </Step>

  <Step title="Navigate to Contact page">
    In left sidebar, click **Pages** > **Contact** or add section to your contact page template.
  </Step>

  <Step title="Add Contact form section">
    If not already present, add the Contact form section to the page.
  </Step>

  <Step title="Configure layout">
    Adjust section width, color scheme, and spacing settings.
  </Step>

  <Step title="Test submission">
    Preview and test form submission to verify email delivery.
  </Step>
</Steps>

<img src="https://mintcdn.com/digifist/f_DhbveqWg3dNhZm/images/theme/sahara/sections/form-contact/form-contact-location.png?fit=max&auto=format&n=f_DhbveqWg3dNhZm&q=85&s=33f4da45c3697c967b020492b559adaf" alt="Contact form in Theme Customizer" width="3280" height="2186" data-path="images/theme/sahara/sections/form-contact/form-contact-location.png" />

## Section settings

<Tabs>
  <Tab title="Layout">
    ### Section width

    Controls the maximum width of the contact form.

    <AccordionGroup>
      <Accordion title="Narrower" icon="compress">
        Most compact width, highly focused (default).

        **Best for:**

        * Maximum form focus
        * Minimal distractions
        * Higher completion rates
        * Standard contact pages

        **Recommended** for most contact forms.
      </Accordion>

      <Accordion title="Narrow" icon="left-right">
        Moderately narrow width, balanced.

        **Best for:**

        * Slightly more spacious layout
        * Pages with additional content
        * Balanced appearance
      </Accordion>

      <Accordion title="Page" icon="window-maximize">
        Standard page container width.

        **Best for:**

        * Matching other page sections
        * Multi-column layouts
        * Additional context alongside form
      </Accordion>

      <Accordion title="Fluid" icon="expand">
        Wider container utilizing more screen space.

        **Best for:**

        * Wide screen displays
        * Forms with extensive content
        * Custom designs
      </Accordion>
    </AccordionGroup>

    <Tip>
      Narrower width (default) improves form readability and completion rates by reducing visual noise and focusing attention.
    </Tip>

    <img src="https://mintcdn.com/digifist/BLUO7ILm4Js-0C_U/images/theme/sahara/sections/form-contact/section-width.png?fit=max&auto=format&n=BLUO7ILm4Js-0C_U&q=85&s=ee1860e6699ce3a383167bea82b4d360" alt="Section width options" width="3280" height="2186" data-path="images/theme/sahara/sections/form-contact/section-width.png" />
  </Tab>

  <Tab title="Styling">
    ### Color scheme

    Select color scheme for form background, text, and input styling.

    <Note>
      Color scheme affects background, text color, input borders, and submit button appearance.
    </Note>

    ### Spacing

    Control vertical spacing around the section:

    * **Spacing top** - Margin above (None, S, M, L, XL)
    * **Spacing bottom** - Margin below (None, S, M, L, XL)

    Default: Spacing top None, Spacing bottom M

    <Note>
      Contact form sections typically use no top spacing when placed directly below a page banner.
    </Note>

    ### Section border

    Add decorative borders: None (default), Top, Bottom, Both

    <img src="https://mintcdn.com/digifist/BLUO7ILm4Js-0C_U/images/theme/sahara/sections/form-contact/section-border.png?fit=max&auto=format&n=BLUO7ILm4Js-0C_U&q=85&s=db655cb3992215cb6b734959a58bc623" alt="Styling options" width="3280" height="2186" data-path="images/theme/sahara/sections/form-contact/section-border.png" />
  </Tab>
</Tabs>

## Form fields

The Contact form includes three pre-configured fields:

<AccordionGroup>
  <Accordion title="Name field" icon="user">
    **Type:** Text input\
    **Required:** No\
    **Auto-fill:** Yes (for logged-in customers)

    Customer's name. Optional field that auto-completes with `customer.name` for logged-in users.

    **Input attributes:**

    * `autocomplete="name"` for browser auto-fill
    * Full-width on mobile, half-width on desktop (shares row with email)
  </Accordion>

  <Accordion title="Email field" icon="envelope">
    **Type:** Email input (required)\
    **Required:** Yes\
    **Auto-fill:** Yes (for logged-in customers)\
    **Validation:** Email format

    Customer's email address. Required field with email validation. Auto-completes with `customer.email` for logged-in users.

    **Input attributes:**

    * `autocomplete="email"` for browser auto-fill
    * `spellcheck="false"` to prevent unwanted corrections
    * `autocapitalize="off"` for proper email formatting
    * `aria-required="true"` for accessibility

    **Error handling:**

    * Displays validation error if email format invalid
    * Shows required field error if left empty
    * Preserves entered value on error for correction
  </Accordion>

  <Accordion title="Message field" icon="message">
    **Type:** Textarea\
    **Required:** No\
    **Auto-fill:** No

    Large text area for customer's message, inquiry, or feedback.

    **Input attributes:**

    * Multi-line text input (textarea)
    * Full-width across all devices
    * Expandable height for longer messages
  </Accordion>
</AccordionGroup>

<img src="https://mintcdn.com/digifist/BLUO7ILm4Js-0C_U/images/theme/sahara/sections/form-contact/form-fields.png?fit=max&auto=format&n=BLUO7ILm4Js-0C_U&q=85&s=a85bb5aa8ab8efaa4da6c61a3ffdb332" alt="Contact form fields" width="3280" height="2186" data-path="images/theme/sahara/sections/form-contact/form-fields.png" />

## Form submission

### Success state

When form is submitted successfully:

* **Success message displayed:**\
  "Thanks for contacting us. We'll get back to you as soon as possible."\
  (Translation key: `contact.form.success`)

* **Email sent:**\
  Form contents delivered to store's customer notification email address (configured in Shopify Settings > Notifications)

* **Customer record:**\
  If customer logged in, inquiry added to their customer record in Shopify admin

<img src="https://mintcdn.com/digifist/f_DhbveqWg3dNhZm/images/theme/sahara/sections/form-contact/success-message.png?fit=max&auto=format&n=f_DhbveqWg3dNhZm&q=85&s=f532168cc5f811da781d8148da1051c6" alt="Form success message" width="3280" height="2186" data-path="images/theme/sahara/sections/form-contact/success-message.png" />

### Error handling

When form submission fails or validation errors occur:

* **Error display:**\
  Red error message shown above form

* **Field preservation:**\
  Customer's entered data preserved for correction

* **Common errors:**
  * "Email address is required"
  * "Email is invalid"
  * Connection/server errors

<Warning>
  Ensure your Shopify store's notification email is correctly configured to receive contact form submissions.
</Warning>

## Best practices

<CardGroup cols={2}>
  <Card title="Narrow width" icon="compress-wide">
    Use Narrower (default) or Narrow width for better form completion rates and reduced distractions.
  </Card>

  <Card title="Page placement" icon="location-dot">
    Place directly below Page banner section with no top spacing for cohesive contact page layout.
  </Card>

  <Card title="Clear heading" icon="heading">
    Use Page banner section heading to introduce the form: "Get in Touch", "Contact Us", "How Can We Help?".
  </Card>

  <Card title="Email verification" icon="envelope-circle-check">
    Test form submission to verify emails arrive at your notification address before going live.
  </Card>

  <Card title="Success confirmation" icon="circle-check">
    Consider adding text in Page banner description setting customer expectations: "We typically respond within 24 hours."
  </Card>

  <Card title="Mobile optimization" icon="mobile">
    Form automatically stacks fields vertically on mobile for optimal usability on small screens.
  </Card>

  <Card title="Accessibility" icon="universal-access">
    Email field includes proper ARIA attributes and required field indicators (\*) for screen readers.
  </Card>

  <Card title="Color contrast" icon="palette">
    Ensure color scheme provides sufficient contrast for input fields and text readability.
  </Card>
</CardGroup>

## Common use cases

<AccordionGroup>
  <Accordion title="Standard contact page" icon="address-card">
    Page banner with heading "Contact Us" and description "Have questions? We're here to help." Contact form below with Narrower width, default color scheme, no top spacing.
  </Accordion>

  <Accordion title="Support inquiry page" icon="headset">
    Page banner heading "Customer Support" with FAQ search enabled. Contact form below with Narrow width for balance with search functionality. Message placeholder guidance: "Describe your issue..."
  </Accordion>

  <Accordion title="Custom order requests" icon="shopping-cart">
    Page banner heading "Custom Order Inquiry" with description explaining custom order process. Contact form with Page width to accommodate additional content. Clear call-to-action in banner.
  </Accordion>

  <Accordion title="Partnership inquiries" icon="handshake">
    Page banner heading "Partner With Us" with business partnership description. Contact form with Narrower width, professional color scheme (scheme-2 or scheme-3), standard spacing.
  </Accordion>

  <Accordion title="General inquiries" icon="circle-question">
    Page banner heading "Get In Touch" with multi-channel contact info (email, phone, hours). Contact form below as primary method with Narrower width and M bottom spacing.
  </Accordion>
</AccordionGroup>

## Related sections

<CardGroup cols={2}>
  <Card title="Page banner" icon="window" href="/themes/sahara/sections/page-banner">
    Page header banners for contact pages
  </Card>

  <Card title="Rich text" icon="align-left" href="/themes/sahara/sections/rich-text">
    Additional contact information and policy text
  </Card>
</CardGroup>

## Email configuration

<AccordionGroup>
  <Accordion title="Configure notification email" icon="gear">
    Contact form submissions are sent to your store's customer notification email address.

    **To configure:**

    1. Go to Shopify Admin > **Settings** > **Notifications**
    2. Scroll to **Staff notification email** section
    3. Set **Customer contact** email address
    4. Save changes

    <Note>
      This email address receives all contact form submissions from your store.
    </Note>
  </Accordion>

  <Accordion title="Notification email content" icon="envelope-open-text">
    Email includes:

    * Customer's name (if provided)
    * Customer's email address
    * Message content
    * Submission timestamp
    * Customer information (if logged in)

    <Tip>
      Set up email filters or labels to organize contact form submissions in your inbox.
    </Tip>
  </Accordion>
</AccordionGroup>
