Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

netlify-forms

БесплатноБез исполняемых скриптовНе проверен

Use this skill whenever a developer wants to add a contact form, signup form, file upload form, or any HTML form to a Netlify site without a backend, or asks…

netlifyот netlify★ 58 звёзд на GitHub

Об этом скилле

Netlify Forms

Use this / not that

<!-- ✅ Reach for this -->
<form name="contact" method="POST" data-netlify="true"> … </form>
// ✅ URL-encoded body built from FormData
fetch(target, {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams(new FormData(form)).toString(),
});

// ❌ JSON is NOT supported. Submissions are lost.
fetch(target, { method: "POST", body: JSON.stringify(data) });
  • netlify (bare attribute) works the same as data-netlify="true".
  • data-remove-prefix only applies to legacy forms created before May 5, 2023. Don't add it to new forms.

⚠️ Prerequisite: enable Forms > Enable form detection in the UI (https://app.netlify.com/projects/{site_name}/forms), then redeploy. Without detection, new or changed forms accept no submissions. Enabling has no effect until the next deploy.

How detection works

  • At deploy time, Netlify parses the static HTML output and finds <form> tags with data-netlify="true" or netlify.
  • It strips that attribute (and netlify-honeypot) and injects <input type="hidden" name="form-name" value="<name>">.
  • The form name is the form's identity in the UI. It must be unique per site.
  • Fields are identified by their name attributes. Multi-selects can use name="role[]".
  • Forms rendered only by client-side JS or SSR are invisible to the build. They need a static HTML counterpart.

Static HTML form (complete)

<form name="contact" method="POST" data-netlify="true" action="/thank-you">
  <input type="hidden" name="subject" value="New lead from %{formName} (%{submissionId})" />
  <label>Name <input type="text" name="name" /></label>
  <label>Email <input type="email" name="email" /></label>
  <label>Role
    <select name="role[]" multiple>
      <option value="leader">Leader</option>
      <option value="follower">Follower</option>
    </select>
  </label>
  <label>Message <textarea name="message"></textarea></label>
  <button type="submit">Send</button>
</form>
  • action: optional custom success page. It must start with / (site-root relative). Without it, visitors see a generic Netlify success page.
  • email field: sets Reply-to on notification emails. Otherwise replies go to [email protected].
  • subject hidden input: sets the notification subject (details below).

AJAX for a static page

document.querySelector("form").addEventListener("submit", (event) => {
  event.preventDefault();
  fetch("/", {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    body: new URLSearchParams(new FormData(event.target)).toString(),
  })
    .then(() => alert("Thank you for your submission"))
    .catch((error) => alert(error));
});

form-name must be in the body. FormData picks up the injected hidden input automatically.

JS-rendered / SSR forms (React, Vue, Gatsby, Next.js, Nuxt, SvelteKit, Astro)

Two parts are required: a detectable static skeleton, plus a component that sends form-name.

1. public/__forms.html — a hidden static copy of every form. Each input name must exactly match what the component submits.

<!DOCTYPE html>
<html>
  <body>
    <form name="pizzaOrder" data-netlify="true" netlify-honeypot="bot-field" hidden>
      <input type="hidden" name="form-name" value="pizzaOrder" />
      <input name="bot-field" />
      <input name="order" type="text" />
      <input name="email" type="email" />
    </form>
  </body>
</html>

If the form uses Netlify-provided reCAPTCHA, also include <div data-netlify-recaptcha="true"></div> in the skeleton.

2. Component — includes the hidden form-name input (or put form-name in the POST body) and submits via AJAX.

export default function PizzaForm() {
  const [status, setStatus] = useState(null);

  const handleSubmit = async (event) => {
    event.preventDefault();
    const body = new URLSearchParams(new FormData(event.target)).toString();
    try {
      const res = await fetch("/__forms.html", {
        method: "POST",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        body,
      });
      setStatus(res.ok ? "ok" : "error");
    } catch {
      setStatus("error");
    }
  };

  return (
    <form name="pizzaOrder" method="POST" onSubmit={handleSubmit}>
      <input type="hidden" name="form-name" value="pizzaOrder" />
      <p hidden><input name="bot-field" /></p>
      <input name="order" type="text" />
      <input name="email" type="email" />
      <button type="submit">Order</button>
      {status === "ok" && <p>Thanks!</p>}
    </form>
  );
}
Полный SKILL.md на GitHub

Установить netlify-forms в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл netlify-forms?

Use this skill whenever a developer wants to add a contact form, signup form, file upload form, or any HTML form to a Netlify site without a backend, or asks why form submissions are missing, going to spam, or returning 404. It covers data-netlify form markup, AJAX/fetch submission, React/Vue/Next.js/Nuxt/SvelteKit/Astro JS-rendered or SSR forms that need a static skeleton, custom thank-you pages, honeypot or reCAPTCHA spam protection, email/Slack/webhook notifications and subject lines, reading or exporting submissions through the Netlify API, and triggering functions on form submission.

Как установить скилл netlify-forms?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл netlify-forms запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить netlify-forms с