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★ 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 asdata-netlify="true".data-remove-prefixonly 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 withdata-netlify="true"ornetlify. - It strips that attribute (and
netlify-honeypot) and injects<input type="hidden" name="form-name" value="<name>">. - The form
nameis the form's identity in the UI. It must be unique per site. - Fields are identified by their
nameattributes. Multi-selects can usename="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.emailfield: setsReply-toon notification emails. Otherwise replies go to[email protected].subjecthidden 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>
);
}
- Next.js Runtime v5 (Next.js 13.5+): form definitions must live in a dedicated static HTML file, and submission must be AJAX, not full-page navigation. See https://docs.netlify.com/build/frameworks/framework-setup-guides/nextjs/overview#v5-breaking-changes
- After AJAX success: han
Установить 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), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic