Contact, form
betaName, email, a subject and a message beside your other contact details; sends as a WhatsApp, text or email message.
Talk to us
A person on the team reads every message and answers within a working day.
- hello@senbon.example
- Phone
- +33 1 84 00 00 00
- Office
- 12 rue des Petites Écuries, Paris
- Use it
- A product's support or sales page, or a business taking requests (events, catering, quotes) without a backend.
- Avoid it
- Several ways to reach you and no form needed: contact-links.
- Pairs with
- FAQ, accordionLocation, map
Installation
It installs into components/blocks/contact-form/, with what it uses (Button, Field, Input, Label, Radio Group, Textarea) and lib/blocks.ts.
Usage
Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):
There is no server behind the form. When the visitor sends it, the block writes the message (your labels.intro, then the fields) and opens it in the app named by channel: WhatsApp, their texts or their mail app, addressed to you. To use your own backend, pass action (the form posts name, email, topic and message), or onSubmit to take the values in code.
The block is in both families: a product's support page, or a restaurant's events and catering.
Events and catering
Birthdays, weddings, office lunches: tell us the date and how many, we answer the same day.
- +237 6 99 00 00 00
- Visit
- Rue Joss, Akwa, Douala
Content
| Field | Type | Limits | Guidance |
|---|---|---|---|
title | string | 2–48 chars | 'Talk to us', 'Events and catering'. |
sublineoptional | string | ≤ 180 chars | Who answers and how fast. |
channel | object | Where the message goes: the visitor's WhatsApp, texts or mail app opens with it written. | |
channel.kind | "whatsapp" | "sms" | "email" | Where the visitor's message opens: their WhatsApp, their texts, or their mail app. | |
channel.to | string | 1–120 chars | The business's number in international form, or its email address. |
fields | object | ||
fields.name | object | ||
fields.name.label | string | 1–32 chars | 'Your name' |
fields.name.placeholderoptional | string | ≤ 48 chars | |
fields.email | object | ||
fields.email.label | string | 1–32 chars | 'Email' |
fields.email.placeholderoptional | string | ≤ 48 chars | |
fields.topicoptional | object | A choice of subjects, shown as chips: two to six short ones. | |
fields.topic.label | string | 1–32 chars | 'About' |
fields.topic.options | string[] | 2–6 items | |
fields.message | object | ||
fields.message.label | string | 1–32 chars | 'Your message' |
fields.message.placeholderoptional | string | ≤ 48 chars | |
submit | string | 1–32 chars | 'Send', 'Send on WhatsApp'. |
detailsoptional | object[] | ≤ 4 items | Other ways to reach you, beside the form. |
details[].label | string | 1–24 chars | 'Email', 'Phone', 'Office'. |
details[].value | string | 1–80 chars | |
details[].hrefoptional | string | ||
imageoptional | object | A static map or a photo, under the details. | |
image.src | string | A local path ('/images/terrace.jpg') or the project's asset URL. | |
image.alt | string | ≤ 140 chars | What the image shows, for people who cannot see it. Empty only if purely decorative. |
image.width | integer | ||
image.height | integer | ||
labels | object | Shown only when needed: in the message, under a field, after sending. | |
labels.intro | string | 1–120 chars | The message's first line: 'Hello, I am writing from your website.' |
labels.required | string | 1–32 chars | Under an empty required field: 'Required'. |
labels.invalidEmail | string | 1–60 chars | Under a malformed address: 'Enter an email like name@example.com'. |
labels.sent | string | 1–160 chars | Once the app opens: 'Your message is ready: send it from your mail app.' |
Props
| Prop | Notes |
|---|---|
content | ContactFormContent; the example when left out |
action | a URL: the form posts its fields there instead of opening a message |
onSubmit | (values) => void: the values in code instead of a message |
id | the section's id, for anchor links; "contact" by default |
headingLevel | 1, 2 or 3: the heading's tag; 2 by default |
className | on the <section>, for spacing |
Accessibility
- Every field has its visible label; an empty field or a malformed address says so under it, and the form does not send.
- The subjects are a radio group, every choice visible.