Skip to content
Siteon

Guide

How do I add a contact form to a static site built with AI?

Load the Siteon script with one line, add the attribute data-sitekit-form to your existing form, and declare its fields in schema.json. Submissions are stored, the business is notified by email and Slack, and the customer gets an automatic thank-you email, with no server, no JavaScript and no separate form service. It works free on the Free plan while you build, and from $4/month per site on your live domain.

Updated:

What you need

Steps

1. Add the script tag

Put one line before </body>, or in <head> with defer. Replace hanaya with your site ID.

<script src="https://cdn.siteon.dev/sitekit.js" data-site="hanaya" defer></script>

2. Mark the form

Add data-sitekit-form to the <form> you already have. Keep the hidden _hp input: it is the bot trap, and it is required.

<form data-sitekit-form="contact">
  <label>Name <input name="name" required autocomplete="name"></label>
  <label>Email <input type="email" name="email" required autocomplete="email"></label>
  <label>Message <textarea name="message"></textarea></label>

  <!-- Bot protection. Place it where people can't see it (required) -->
  <input type="text" name="_hp" tabindex="-1" autocomplete="off"
         style="position:absolute;left:-9999px" aria-hidden="true">

  <button type="submit">Send</button>
</form>

<div data-sitekit-success role="status" aria-live="polite" hidden>Thank you for your inquiry.</div>
<div data-sitekit-error role="status" aria-live="polite" hidden></div>

3. Declare the fields in schema.json and apply it

forms[].key must match the data-sitekit-form value, and each fields[].key must match an input's name.

{
  "forms": [
    { "key": "contact", "label": "Contact", "fields": [
      { "key": "name", "label": "Name", "type": "text", "required": true },
      { "key": "email", "label": "Email address", "type": "email", "required": true },
      { "key": "message", "label": "Message", "type": "textarea" }
    ] }
  ]
}
siteon schema push --site hanaya        # validate and apply
siteon forms test contact --site hanaya # send a test notification

4. Turn on notifications and the thank-you email

In the dashboard, open "Settings → Notifications → each form". Add the email addresses to notify, a Slack Incoming Webhook URL if you use Slack, and switch on the thank-you email (auto-reply). The thank-you email goes to the address in the form's type: "email" field.

5. Publish

Publish the folder with siteon deploy ./dist --site hanaya (first time: siteon hosting enable --site hanaya). You can also keep your current hosting: the form works with the script tag alone.

What it costs

Prices are per site. The form, notifications, auto-replies and spam protection are included on every plan.

FreeLiteStandardBusiness
Monthly$0$4$12$39
Form submissions50/mo500/mo1K/mo5K/mo

Limits and what's coming

This page is also available as Markdown. For AI agents, pass llms-full.txt (full text).