# Contact, form

- **[Sections](/blocks/)**
- **[Contact](/blocks/contact/)**
- **Contact, form**

Heading and contact details beside a simple message form. Presentation only: the page wires the submit.

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/contact-form
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/contact-form';
  ```

Also called

- contact/form

- **Category**: A form, a booking panel or office details. The page wires the submit. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: Heading and contact details on the left beside a message form on the right. Presentation only: the page wires the submit. For a list of addresses without a form, use `contact-channels` or `contact-minimal`.
- **Writing for it**: - Details take up to four label and value pairs (40 and 120) in plain text, not links; keep to the phone, visit and hours people ask for.
- Leave nameLabel empty to drop the name field and keep only email and message. messageLabel (40) names the last field.
- messageType turns the last field into a single line: domain for a site address, url for a full link, email or text. Set messageName if your backend expects a field other than 'message'.
- **Watch out for**: The sent and error texts are drawn only when the host sets status, usually after a redirect with ?sent=1. When status is sent, the fields are hidden and only the message shows. An empty messageLabel removes the last field.

## Pairs well with

- **[FAQ, with a support card](/blocks/faq/support)**
- **[Logos strip](/blocks/logo-cloud/row)**
- **[Footer, columns](/blocks/footer/link-columns)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import ContactForm from '@/components/klarhimmel/blocks/contact-form';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <ContactForm props={{
          "eyebrow": "Name the topic",
          "title": "Ask what they want to tell you",
          "description": "Say in one sentence who reads the message and when they get a reply.",
          "details": [
            {
              "label": "First detail",
              "value": "hello@yourcompany.example",
              "href": "mailto:hello@yourcompany.example"
            },
            {
              "label": "Second detail",
              "value": "Give the street address and town"
            },
            {
              "label": "Third detail",
              "value": "Give the days and opening hours"
            }
          ],
          "nameLabel": "Full name",
          "emailLabel": "Your email",
          "messageLabel": "Your message",
          "submit": "Send",
          "consent": "Say in one line what the details are used for.",
          "messages": {
            "sent": "Thank them and say when they can expect a reply.",
            "error": "Say it failed and what they can do instead."
          },
          "errors": {
            "required": "Say this field is needed.",
            "email": "Say what a valid email address looks like.",
            "url": "Say what a valid web address looks like, with an example.",
            "domain": "Say what a site address looks like, with one."
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters.
- **details**: List of up to 6. Each item: label, value, href (optional), note (optional).
- **nameLabel**: Text, up to 40 characters. Optional; empty is not rendered.
- **emailLabel**: Text, up to 40 characters.
- **phoneLabel**: Text, up to 40 characters. Optional; empty is not rendered.
- **address**: Fields: street (optional), postcode (optional), city (optional). Optional; empty is not rendered.
- **fields**: List of up to 30. Each item: kind ('heading' | 'text' | 'select' | 'radio' | 'checkboxes' | 'date' | 'number'), label, name (optional), options (optional), required (optional), placeholder (optional), hint (optional), after (optional). Optional; empty is not rendered.
- **messageLabel**: Text, up to 80 characters.
- **messageType**: One of 'textarea', 'url', 'domain', 'email', 'text'. Optional; empty is not rendered.
- **messageName**: Text, up to 40 characters. Optional; empty is not rendered.
- **errors**: Fields: required (optional), email (optional), url (optional), domain (optional). Optional; empty is not rendered.
- **submit**: Text, up to 40 characters.
- **consent**: Text, up to 160 characters.
- **consentLink**: Optional; empty is not rendered.
- **consentRequired**: Optional; empty is not rendered.
- **honeypot**: Text, up to 40 characters. Optional; empty is not rendered.
- **action**: Text, up to 300 characters. Optional; empty is not rendered.
- **method**: One of 'post', 'get'. Optional; empty is not rendered.
- **hidden**: Optional; empty is not rendered.
- **captcha**: Optional; empty is not rendered.
- **captchaSitekey**: Text, up to 100 characters. Optional; empty is not rendered.
- **status**: One of 'idle', 'sent', 'error'. Optional; empty is not rendered.
- **messages**: Fields: sent, error. Optional; empty is not rendered.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/contact/channels)

[Next](/blocks/contact/form-grid)
